fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int ndiv(long long z)
  5. {
  6. int i,s,count;
  7. s=sqrt(z);
  8. count++;
  9. for(i=1;i<=s;i++)
  10. {
  11. if(z%i==0)
  12. {
  13. count++;
  14. }
  15. }
  16. if(s*s==z)
  17. return 2*count-1;
  18. else
  19. return 2*count;
  20. }
  21. int main()
  22. {
  23. for(int i=1;i<101;i++)
  24. {
  25. cout<<ndiv(i)<<endl;
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
3
4
4
5
4
6
4
6
5
6
4
8
4
6
6
7
4
8
4
8
6
6
4
10
5
6
6
8
4
10
4
8
6
6
6
11
4
6
6
10
4
10
4
8
8
6
4
12
5
8
6
8
4
10
6
10
6
6
4
14
4
6
8
9
6
10
4
8
6
10
4
14
4
6
8
8
6
10
4
12
7
6
4
14
6
6
6
10
4
14
6
8
6
6
6
14
4
8
8
11