Accepted
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-11-11 03:25:32
- Judged By
- Score
- 100
- Total Time
- 22ms
- Peak Memory
- 3.125 MiB