Wrong Answer
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:08:01
- Judged At
- 2024-11-11 03:24:43
- Judged By
- Score
- 20
- Total Time
- 3ms
- Peak Memory
- 520.0 KiB