计算输入整数的各位数字之和
方法/步骤
1
ubuntu 14.04 linux cgcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
2
#include
3
xxx@linux:~/code$ gcc -o sum sum.c xxx@linux:~/code$ ./sum 123the integer is 123 and the sum of decimal digits is 6 xxx@linux:~/code$ ./sum12345the integer is 12345 and the sum of decimal digits is 15