fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int t;
  5. int p,w;
  6. int wynik=1;
  7.  
  8. int main()
  9. {
  10. cin>>t;
  11.  
  12. for(int i=0;i<t;i++)
  13. {
  14. cin>>p>>w;
  15.  
  16. while(w>0)
  17. {
  18. wynik*=p;
  19. w--;
  20. }
  21. cout<<wynik<<endl;
  22. wynik = 1;
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 3416KB
stdin
2
2 3
3 3
stdout
8
27