#include <iostream>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
string s, temp;
int ans = 0;
while (getline(cin, s)) {
for (int i = 0; i < s.length(); i++) {
if (s[i] != ',') {
temp += s[i];
} else {
ans += stoi(temp);
temp.clear();
}
}
}
ans += stoi(temp);
cout << ans;
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 10828๋ฒ - ์คํ (0) | 2021.10.25 |
---|---|
[๋ฐฑ์ค,c++] 10825๋ฒ - ๊ตญ์์ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10824๋ฒ - ๋ค ์ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10822๋ฒ - ๋ํ๊ธฐ (0) | 2021.10.24 |
[๋ฐฑ์ค,c++] 10820๋ฒ - ๋ฌธ์์ด ๋ถ์ (0) | 2021.10.24 |
[๋ฐฑ์ค,c++] 10819๋ฒ - ์ฐจ์ด๋ฅผ ์ต๋๋ก (0) | 2021.10.24 |
๋๊ธ