#include
int isprime(int n)
{ int i;
for(i=2; i*i<=n; i++)
if(n%i==0)return 0;
return n>1;
}
void fenge(int n)
{ if(n>9)fenge(n/10);
printf("%d ",n%10);
}
int main()
{ int n;
scanf("%d",&n);
fenge(n);
printf("\n%d %s是一个素数\n",n,isprime(n)?"":"不");
return 0;
}
#include
int main(void)
{
int b,t,x,c;
printf("Input an integer: ");
scanf("%d",&x);
c=0;
if(x>=0){
t=x%10;
while(x!=0){
x=x/10;
b=x%10;
t=t*10+b;
}
t=t/10;
while(t!=0){
printf("%d ",t%10);
t=t/10;
}
}
if(x<0){
x=-x;
t=x%10;
while(x!=0){
x=x/10;
b=x%10;
t=t*10+b;
}
t=t/10;
while(t!=0){
c++;
if(c<=1)
printf("- ");
else printf(" ");
printf("%d",t%10);
t=t/10;
}
}
return 0;
}