/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 2ms 332.0 KiB
#3 Accepted 2ms 440.0 KiB
#4 Accepted 2ms 332.0 KiB

Code

// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;

int main() {
    
   int t;
   cin>>t;
   while(t--){
       int sum=0;
       string str;
       cin>>str;
       
       for(int i=0;i<str.length();i++){
          
          if(str[i]>='0'&&str[i]<='9'){
              
              sum+=int(str[i])-48;
          } 
           
           
       }
       
       cout<<sum<<endl;
       
       
       
       
       
   }
    

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1072 Valuable digit
Contest
Brain Booster #4
Language
C++17 (G++ 13.2.0)
Submit At
2024-07-14 16:31:58
Judged At
2024-10-03 13:37:33
Judged By
Score
100
Total Time
2ms
Peak Memory
440.0 KiB