/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Accepted 1ms 516.0 KiB
#3 Accepted 1ms 580.0 KiB
#4 Accepted 1ms 328.0 KiB

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