fork download
  1. #include<bits.stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, status = 1, num = 3, count, c;
  7.  
  8. cin >> n;
  9.  
  10. if ( n >= 1 )
  11. {
  12. cout << 2 << endl;
  13. }
  14.  
  15. for ( count = 2 ; count <=n ; )
  16. {
  17. for ( c = 2 ; c <= (int)sqrt(num) ; c++ )
  18. {
  19. if ( num%c == 0 )
  20. {
  21. status = 0;
  22. break;
  23. }
  24. }
  25. if ( status != 0 )
  26. {
  27. cout << num << " ";
  28. count++;
  29. }
  30. status = 1;
  31. num++;
  32. }
  33.  
  34. return 0;
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:25: fatal error: bits.stdc++.h: No such file or directory
  #include<bits.stdc++.h>
                         ^
compilation terminated.
stdout
Standard output is empty