fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. long long h,i,j,n=1,t=0;
  6. cin>>h;
  7. while(h--){
  8. t=0,n=1;
  9. cin>>i;
  10. for(j=1;j<=i;j++){
  11. n=n*j;
  12. }
  13. cout<<n;
  14. string u;
  15. u=to_string(n);
  16. //cout<<u;
  17. for(j=0;j<u.size();j++){
  18. if(u[j]=='0'){
  19. t++;
  20. }
  21. }
  22. cout<<t<<"\n";
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5436KB
stdin
2
5
3
stdout
1201
60