a53

FactorialnEasy

a53
Dec 27th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin>>n;
  8. if(n==1)
  9. {
  10. cout<<1;
  11. exit(0);
  12. }
  13. double sum=0;
  14. for(int i=2;i<=n;i++)
  15. sum+=(double)log(i)/(double)log(10);
  16. sum*=(double)n;
  17. cout<<fixed<<setprecision(0)<<ceil(sum);
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment