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 | #include <iostream>
#include <string>
#include <vector>
using namespace std;
//------------------------------------
// 이 곳에 Class StringAnalyzer를 정의하시오.
//----------이하 수정 금지 --------------------------
int main()
{
string str;
int v;
int k;
vector<int> values;
getline(cin, str);
cin >> v;
while (true) {
cin >> k;
if (k == -999) {
break;
}
values.push_back(k);
}
StringAnalyzer sa(str);
cout << sa.getStrLength() << endl;
cout << sa.getCharAt(v) << endl;
cout << sa.getCharSum(values) << endl;
return 0;
}
|