fork download
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. int ile,x;
  7. long long y;
  8. unsigned long long z;
  9.  
  10. int main()
  11. {
  12. cin>>x;
  13. for(int i=1; i<=x; i++)
  14. {
  15. z=0;
  16. cin>>y;
  17. z+=1;
  18. for(int j=1; j<=y; j++)
  19. {
  20. z=z*j;
  21. }
  22. cout<<(z/10%10)<<" "<<(z%10)<<endl;
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 15232KB
stdin
6
10
20
30
40
50
60
stdout
0 0
0 0
1 2
1 6
3 2
6 0