啊哈C語言第五章第七節

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a,b,c,e,x,num;
    scanf("%d",&x);
    a=x/100%10;
    b=x/10%10;
    c=x/1%10;
    e=x/1000%10;
    printf("%d",num=a+b+c+e);


    system ("pause");
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_42252769/article/details/80571084