Advertisement
Guest User

245 mada

a guest
Nov 21st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<climits>
  4. using namespace std;
  5. int main()
  6. {
  7. int n, i, r, d, c=0, cmax=INT_MIN;
  8. cin>>n;
  9. for(i=1; i<=n; i++)
  10. {
  11. r=sqrt(i);
  12. for(d=1; d<=r; d++)
  13. {
  14. if(i%d==0)
  15. {
  16. c++;
  17. }
  18. }
  19. if(c>cmax)
  20. {
  21. cmax=c;
  22. }
  23. }
  24. cout<<
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement