标签:clu space names mos bsp turn mes std cin
#include"bits/stdc++.h" using namespace std; int quick_pow(int n, int k) { int ans=1; while(k) { if(k & 1) ans = ans * n % 10; n = n * n % 10; k >>= 1; } return ans; } int main() { int T, n; cin >> T; while(T--) { cin >> n; cout << quick_pow(n%10,n) << endl; } return 0; }
标签:clu space names mos bsp turn mes std cin
原文地址:https://www.cnblogs.com/Angel-Demon/p/9681690.html