#include<stdio.h>
int product(unsigned int b);
int main()
{
unsigned int x,a;
scanf("%d",&x);
a=product(x);
printf("所有位数上的数字之和:%d",a);
}
int product(unsigned int b)
{
int y,m;
if(b<10)
{return b;}
else
{
do
{
y=b%10;
m=y+m;
b=b/10;
}while(b!=0);
}
return b;
}
我无法得出正确结果 请问哪里出错了
谢谢泥,可是我的程序为什么错了?