fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int potega(int podst, int wykl)
  6. {
  7. int wynik = 1;
  8.  
  9. for (int j = 0; j < wykl; j++)
  10. wynik *= podst;
  11.  
  12. return wynik;
  13. }
  14.  
  15. int a, b, c, d;
  16.  
  17. int main()
  18. {
  19. cin >> a;
  20.  
  21. for (int i = 0; i < a; i++)
  22. {
  23. cin >> b >> c;
  24. d = potega(b, c);
  25. cout << d % 10;
  26. }
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Standard output is empty