24 lines
223 B
C++
24 lines
223 B
C++
#include<iostream>
|
|
using namespace std;
|
|
|
|
int main(){
|
|
|
|
|
|
for(int a=2;a<=100;a++){
|
|
|
|
bool x=true;
|
|
|
|
for(int i=2;i*i<=a;i++)
|
|
if(a%i==0){
|
|
|
|
x=false;
|
|
break;
|
|
}
|
|
if(x){
|
|
cout<<a<<" ";
|
|
}
|
|
}
|
|
cout<<endl;
|
|
return 0;
|
|
}
|