#include "stdio.h"
#include "math.h"
void main()
{
char c1,c2,c3,c4;
int x;
while(1) //无限循环
{
scanf("%d",&x);
if(x>999||x<-999 )
{
printf("you are wrong \n");
printf("input again!\n");
}
else
{
break;
}
}
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);
}
我没调试....
[此贴子已经被作者于2007-5-30 17:37:19编辑过]