C语言在线作业编程题3:计算三位数的位数和
#include<stdio.h>
#include<math.h>
int main()
{
int x,a,b,c,d;
scanf("%d",&x);
a=abs(x)/100;
b=abs(x)/10%10;
c=abs(x)%10;
d=a+b+c;
printf("%d",d);
}
C语言在线作业编程题3:计算三位数的位数和
#include<stdio.h>
#include<math.h>
int main()
{
int x,a,b,c,d;
scanf("%d",&x);
a=abs(x)/100;
b=abs(x)/10%10;
c=abs(x)%10;
d=a+b+c;
printf("%d",d);
}