fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. unsigned long long a,b,c,d;
  5. int main(){
  6. cin >> c;
  7. for(int i=0;i<c;i++){
  8. cin >> a >>b;
  9. d = pow(a,b);
  10. cout <<d%10<<endl;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 5360KB
stdin
Standard input is empty
stdout
Standard output is empty