/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 764.0 KiB
#4 Accepted 1ms 764.0 KiB

Code

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**
*                       BISMILLAHIR RAHMANIR RAHIM                           *
**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define s(v)       sort(v.begin(),v.end())
#define r(v)       reverse(v.begin(),v.end())
#define pf         printf
#define sf         scanf
#define pb         push_back
#define GCD(x,y)   __gcd(x, y)
#define ll         long long
#define lld        long double
#define vs         v.size()
#define ss         s.size()
#define sd         second
#define mp         make_pair
#define ii         pair<long long, long long>
#define iii        pair<long long, ii>
#define cii        pair<char, ii>
#define CheckMate  return
using namespace std;

const long long MOD = 1000000007;
void oacm() {
    string s;
    cin>>s;
    int sum = 0;
    for(int i=0; i<s.size(); i++){
        if(s[i] >= '0' && s[i] <= '9') sum += s[i]-'0';
    }
    cout<<sum<<endl;
}

int main() {
    fast;
    int t;
    cin >> t;
    while (t--) {
        oacm();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1072 Valuable digit
Language
C++17 (G++ 13.2.0)
Submit At
2024-09-05 08:00:22
Judged At
2024-11-11 03:04:18
Judged By
Score
100
Total Time
1ms
Peak Memory
764.0 KiB