#include<stdio.h>
void main()
int iNum,iSum;
int i1,i2,i3;
printf("请输入一个三位数:");
scanf("%d",iNum);
i1=iNum%10;
i2=iNum/10%10;
i3=iNum/100;
iSum=i1+i2+i3;
printf("%d",iSum);
}
#include<stdio.h>
void main()
int iNum,iSum;
int i1,i2,i3;
printf("请输入一个三位数:");
scanf("%d",iNum);
i1=iNum%10;
i2=iNum/10%10;
i3=iNum/100;
iSum=i1+i2+i3;
printf("%d",iSum);
}