-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5026.cpp
More file actions
40 lines (38 loc) · 767 Bytes
/
5026.cpp
File metadata and controls
40 lines (38 loc) · 767 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
// 5026. 박사 과정
// 2021.06.05
// 문자열
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n = 0, sum = 0, temp = 0;
string s;
cin >> n;
for (int i = 0; i < n; i++)
{
sum = 0;
cin >> s;
if (s == "P=NP")
{
cout << "skipped" << endl;
}
else
{
for (int j = 0; j < s.size(); j++)
{
temp = 0;
while (s[j] != '+' && s[j] != '\0')
{
temp *= 10;
temp += s[j] - '0';
j++;
}
sum += temp;
}
cout << sum << endl;
s.clear();
}
}
return 0;
}