/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 16ms 3.074 MiB
#2 Accepted 16ms 3.051 MiB
#3 Accepted 16ms 2.945 MiB
#4 Accepted 16ms 3.008 MiB

Code

t=int(input())
count=0
for i in range(t):
    s=input()
    for i in range(len(s)):
        if (s[i]=='1'):
            count+=1
        elif (s[i]=='2'):
            count+=2
        elif (s[i]=='3'):
            count+=3
        elif (s[i]=='4'):
            count+=4
        elif (s[i]=='5'):
            count+=5
        elif (s[i]=='6'):
            count+=6
        elif (s[i]=='7'):
            count+=7
        elif (s[i]=='8'):
            count+=8
        elif (s[i]=='9'):
            count+=9
        else:
            pass
    print(count)
    count=0

Information

Submit By
Type
Submission
Problem
P1072 Valuable digit
Contest
Brain Booster #4
Language
Python 3 (Python 3.12.3)
Submit At
2024-07-14 15:44:12
Judged At
2024-10-03 13:39:17
Judged By
Score
100
Total Time
16ms
Peak Memory
3.074 MiB