-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10174.cpp
45 lines (42 loc) · 818 Bytes
/
10174.cpp
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
// 10174. 팰린드롬
// 2022.04.16
// 구현
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n;
cin >> n;
cin.ignore();
string s;
for (int i = 0; i < n; i++)
{
getline(cin, s);
bool IsPalindrome = true;
for (int i = 0; i < s.size(); i++)
{
if (s[i] >= 'A' && s[i] <= 'Z')
{
s[i] = tolower(s[i]);
}
}
for (int i = 0; i < s.size() / 2; i++)
{
if (s[i] != s[s.size() - i - 1])
{
IsPalindrome = false;
break;
}
}
if (IsPalindrome)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
}
return 0;
}