Accepted
Code
#include<stdio.h>
int main(){
int T;
scanf("%d",&T);
for(int i=0;i<T;i++){
char S[100];
scanf("%s",&S);
int j,sum;
j=sum=0;
while(S[j]!='\0'){
if(S[j]>='0'&& S[j]<='9'){
sum+=(S[j]-'0');
}
j++;
}
printf("%d\n",sum);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1072 Valuable digit
- Contest
- Brain Booster #4
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-07-14 16:40:55
- Judged At
- 2024-11-11 03:23:49
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 580.0 KiB