#include
using namespace std;
int isSimple (int x)
{
int retVal = 1;
int i = 2;
while (i<=sqrt((double)x) && retVal==1)<br>{
if (x%i==0) retVal=0;
i++;
}
return retVal;
}
void main(){
int n(0);
cout<<"write n "; cin>>n;
if (n < 3)
cout<<"error";<br> else {
for (int i=2;i<=n;i++)<br> if (isSimple(i)) cout<<i<<" ";<br> }
cout<<endl;<br> system("pause");
}