#include<iostream>
using namespace std;
int main ()
{
int X,Y,D,prime num=1;
cin>>D;
while(D!=0)
{
X=D/10;
Y=D%10;
cout<<Y<<endl;
D=X;
for(int j=2; j<Y; j++)
{
if(Y%j==0)
{prime num=0;
j=Y;
}
}
}
if(prime num==1) cout<<"stange";
else
cout<<" not stange";
return 0;
}
using namespace std;
int main ()
{
int X,Y,D,prime num=1;
cin>>D;
while(D!=0)
{
X=D/10;
Y=D%10;
cout<<Y<<endl;
D=X;
for(int j=2; j<Y; j++)
{
if(Y%j==0)
{prime num=0;
j=Y;
}
}
}
if(prime num==1) cout<<"stange";
else
cout<<" not stange";
return 0;
}
No comments:
Post a Comment