C++ :
#include<iostream> using namespace std; int main() { int t=0; for (int i=2; i<=100; i++){ int j; for (j=2; j<=i/2; j++) if (i%j==0) break; if (j>i/2){ t++; if (t%5==0) cout<<i<<endl; else cout<<i<<" "; } } return 0; }
By signing up a 津桥OJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 津桥OJ universal account