Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: letdown
Problemset: ผลรวมของเลขหลัก
Language: c
Time: 0.003 second
Submitted On: 2025-10-02 20:06:27
#include <stdio.h>
#include <math.h>
#include <string.h>
int main() {
char s[12];
scanf("%s", s);
int ans = 0;
for (int i=0; i<strlen(s); i++) {
ans += (int) s[i] - '0';
}
printf("%d\n", ans);
}