#include <iostream>
#include <string>
using namespace std;
string s;
int test()
{
int tc = 0;
cin >> tc;
for (int t = 1; t <= tc; t++)
{
bool flag = true;
cin >> s;
for (int i = 0; i < s.size() / 2; i++)
{
int end = s.size() - 1 - i;
if ( s[i] == '?' || s[end] == '?')
continue;
if (s[i] != s[end])
{
flag = false;
break;
}
}
if (flag)
cout << "#" << t << " Exist\n";
else
cout << "#" << t << " Not exist\n";
}
return 0;
}
둘 중에 하나라도 와일드카드가 있다면 넘어가기!!
'공부 > SWEA' 카테고리의 다른 글
SWEA 3975. 승률 비교하기 (C++) (0) | 2024.05.06 |
---|---|
SWEA 5986. 새샘이와 세 소수 (C++) (0) | 2024.05.06 |
SWEA 1860. 진기의 최고급 붕어빵 (C++) (1) | 2024.05.06 |
SWEA 9940. 순열1 (C++) (0) | 2024.05.05 |
SWEA 8338. 계산기 (C++) (0) | 2024.05.05 |