fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int x;
  7. cin>>x;
  8. for(int j=1;j<=x;j++){
  9.  
  10.  
  11. for(int i=2; i<=j/2;i++){
  12. if(j%i!=0){
  13. cout<<j<<endl;
  14.  
  15. }
  16. }
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5284KB
stdin
10
stdout
5
7
7
8
9
9
10
10