看看这是不是你想要的:
#include "stdio.h"
#include "math.h"
main()
{
char c1,c2,c3,c4;
int x;
while(1)
{ scanf("%d",&x);
if(x>=-999&&x<=999)
{ printf("You are right!");
c1=(x>=0?'+':'-');
x=abs(x);
c4=x%10+48;
x=x/10;
c3=x%10+48;
c2=x/10+48;
printf("\n%c\n%c\n%c\n%c",c1,c2,c3,c4);
putchar('\n');
printf("\nThe END.");
break;
}
else
printf("You are wrong!\nPLEASE AGAIN:");
}
}
#include "stdio.h"
#include "math.h"
main()
{
char c1,c2,c3,c4;
int x;
while(1)
{ scanf("%d",&x);
if(x>=-999&&x<=999)
{ printf("You are right!");
c1=(x>=0?'+':'-');
x=abs(x);
c4=x%10+48;
x=x/10;
c3=x%10+48;
c2=x/10+48;
printf("\n%c\n%c\n%c\n%c",c1,c2,c3,c4);
putchar('\n');
printf("\nThe END.");
break;
}
else
printf("You are wrong!\nPLEASE AGAIN:");
}
}