-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5698.cpp
More file actions
47 lines (41 loc) · 755 Bytes
/
5698.cpp
File metadata and controls
47 lines (41 loc) · 755 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
// 5698. Tautogram
// 2021.09.05
// 문자열 처리
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
char autogram;
while (1)
{
getline(cin, s);
autogram = tolower(s[0]);
if (s == "*")
{
break;
}
bool flag = true;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == ' ')
{
if (tolower(s[i + 1]) != autogram)
{
flag = false;
break;
}
}
}
if (flag)
{
cout << "Y" << endl;
}
else
{
cout << "N" << endl;
}
}
return 0;
}