fork(1) download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. void ostatnia (const std::string& wynik)
  7. {
  8. std::size_t znajdz = wynik.find_last_of(wynik);
  9. std::cout << wynik.at(znajdz) << '\n';
  10. }
  11.  
  12. unsigned long a, b, D;
  13. char x1[1000];
  14.  
  15. int main()
  16. {
  17. cin>>D;
  18. for(int j = 0; j<D; j++){
  19. cin>>a>>b;
  20.  
  21. int wynik = 1;
  22.  
  23. for(int i = 0; i<b; i++)
  24. wynik*=a;
  25.  
  26. itoa(wynik, x1, 10);
  27. std::string x (x1);
  28. ostatnia (x);}
  29. return 0;
  30. }
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:26:5: error: ‘itoa’ was not declared in this scope
     itoa(wynik, x1, 10);
     ^~~~
prog.cpp:26:5: note: suggested alternative: ‘atol’
     itoa(wynik, x1, 10);
     ^~~~
     atol
stdout
Standard output is empty