-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path10823.cpp
More file actions
47 lines (39 loc) · 754 Bytes
/
Copy path10823.cpp
File metadata and controls
47 lines (39 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#define xx first
#define yy second
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = long long;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int main()
{
string in, str = "";
while (cin >> in)
str += in;
string tmp = "";
int sum = 0;
for (int i = 0; i < str.size(); i++)
{
if (str[i] == ',')
{
sum += stoi(tmp);
tmp = "";
continue;
}
tmp += str[i];
}
sum += stoi(tmp);
cout << sum;
return 0;
}