/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Wrong Answer 1ms 320.0 KiB
#3 Wrong Answer 1ms 324.0 KiB

Code

#include <iostream>
#include <string>
using namespace std;

int main() {
    int T;
    cin >> T;
    cin.ignore(); 
    
    while (T--) {
        string S;
        getline(cin, S);
        
        int totalValue = 0;
        for (char ch : S) {
            if (isdigit(ch)) {
                totalValue += ch - '0'; 
            }
        }
        
        cout << totalValue << 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:07:30
Judged At
2024-11-11 03:24:44
Judged By
Score
20
Total Time
1ms
Peak Memory
324.0 KiB