-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2204.cpp
More file actions
40 lines (36 loc) · 796 Bytes
/
2204.cpp
File metadata and controls
40 lines (36 loc) · 796 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
// 2204. 도비의 난독증 테스트
// 2021.06.10
// 문자열
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int n;
string s;
while (1)
{
cin >> n;
if (n == 0)
{
break;
}
string ans = "";
cin >> ans;
for (int i = 1; i < n; i++)
{
cin >> s;
string sToLower = s;
string ansToLower = ans;
transform(sToLower.begin(), sToLower.end(), sToLower.begin(), ::tolower);
transform(ansToLower.begin(), ansToLower.end(), ansToLower.begin(), ::tolower);
if (ansToLower > sToLower)
{
ans = s;
}
}
cout << ans << endl;
}
return 0;
}