#include<stdio.h> int main() { int a,b,c,number; scanf("%d",&number); printf("百位:%d\n",a=number/100); printf("十位:%d\n",b=(number-100*a)/10); printf("个位:%d\n",c=number-100*a-10*b); return 0; }
以此类推,若该数不止三位,也可将其各位输出。
原文地址:http://10740184.blog.51cto.com/10730184/1700631