Wrong Answer
Code
#include <stdio.h>
#include <ctype.h>
int main() {
int T;
scanf("%d", &T);
getchar();
while (T--) {
char S[1001];
fgets(S, sizeof(S), stdin);
int total = 0;
for (int i = 0; S[i] != '\0'; i++) {
if (isdigit(S[i])) {
total+= S[i] - '0';
}
}
printf("%d\n", total);
return 0;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1072 Valuable digit
- Contest
- Brain Booster #4
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2024-07-14 16:10:03
- Judged At
- 2024-11-11 03:24:38
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 320.0 KiB