fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <vector>
  4. #include <queue>
  5. #include <stack>
  6. #include <string>
  7. #include <algorithm>
  8. #include <cmath>
  9. #include <cstdio>
  10. using namespace std;
  11.  
  12. int main ()
  13. {
  14. long long count = 0;
  15. int N = 100000;
  16. for (int i=2; i<N; i++)
  17. for (int j=2; j*j<=i; j++)
  18. {
  19. count++;
  20. if (i % j == 0)
  21. break;
  22. else if (j+1 > sqrt(i)) {
  23. //cout << i << " ";
  24. }
  25. }
  26.  
  27. cout << "\ncnt : " << count;
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 3468KB
stdin
Standard input is empty
stdout
cnt : 2745693