1061 Rightmost Digit

来源:互联网 发布:身份证 淘宝 海关 编辑:程序博客网 时间:2024/05/16 11:18
#include<iostream>using namespace std;int main(){int t,m;long n;while (cin >> t){while (t--&&cin >> n){if (n > 10)m = n % 10;else m = n;m = pow(m, n);m = m % 10;cout << m << endl;}}return 0;}

0 0