#include <stdio.h>
int main() {
int i;
char s[5];
scanf("%d",&i);
if (1000<=i && i<=9999) {
sprintf(s,"%d",i);
printf("%c %c %c %c %c%c\n",s[3],s[2],s[1],s[0],s[1],s[2]);
} else {
printf("%d is not 4 dights positive integer!\n",i);
}
return 0;
}
不知道你这个问题是否已经解决, 如果还没有解决的话:测试数据1: