#include <stdio.h>int main(){int n,sum=0;scanf("%d",&n);while(n!=0){sum+=n%10;n/=10;}printf("%d\n",sum);return 0;}
1500字范文,内容丰富有趣,写作好帮手!
时间:2023-05-11 15:48:33
#include <stdio.h>int main(){int n,sum=0;scanf("%d",&n);while(n!=0){sum+=n%10;n/=10;}printf("%d\n",sum);return 0;}