fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int p,n,i,s,w,j,d;
  7. cin>>p;
  8. for(int k=1;k<=p;k++)
  9. {
  10. cin>>n;
  11. for(i=1,s=1;i<=n;i++)
  12. {
  13. s=s*i;
  14. }
  15. w=s%100;
  16. j=w%10;
  17. d=w/10;
  18. cout<<d<<" "<<j<<endl;
  19. }
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 15232KB
stdin
11
1
4
3001
3
5
7
9
1
2
3
56
stdout
0 1
2 4
0 0
0 6
2 0
4 0
8 0
0 1
0 2
0 6
0 0