http://acm.njupt.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1050
#include <stdio.h>
#include <string.h>int main()
{
char str[10000];
int sum;
int index, len;
scanf("%s", str);
len = strlen(str);
for (index = 0; index < len; index++)
{
sum = str[index] - '0' + sum;
}
printf("%d\n", sum);
return 0;
}