fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. int D;
  9. cin>>D;
  10. int *tab1=new int[D] ;
  11. int *tab2=new int[D] ;
  12. for(int i=0;D>i;i++)
  13. {
  14. cin>>tab1[D];
  15. cin>>tab2[D];
  16. int pot=pow(tab1[D],tab2[D]);
  17. cout<< (pot%10);
  18. cout<<endl;
  19. }
  20.  
  21. delete [] tab1;
  22. delete [] tab2;
  23. }
Runtime error #stdin #stdout #stderr 0s 3476KB
stdin
11
1289312391 0
1 2321323123
2 324324345
3 435435436
4 9080237
5 2163062
6 96123412
7 921638125
8 2128963591
9 21538123
0 182931253
stdout
1
1
1
1
1
1
1
1
1
1
1
stderr
*** Error in `./prog': free(): invalid next size (fast): 0x08661a10 ***