https://www.acmicpc.net/problem/10988

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

string s;
string temp;
bool bResult;

int main()
{
    cin >> s;
    temp = s;
    reverse(s.begin(), s.end());

    if (s == temp)
        bResult = true;

    cout << bResult << endl;
}
  • 생각보다 더 쉬운 문제였다
  • 입력받은 string 변수를 다른 변수에 저장하고 reverse 함수를 이용하여 두 변수를 비교하면 되는 문제이다

'코딩 태스트 > 문제풀이' 카테고리의 다른 글

ROT13  (0) 2025.01.10
농구경기  (1) 2025.01.10
트럭 주차(X)  (0) 2025.01.10
알파벳 개수  (0) 2025.01.10
일곱 난쟁이(x)  (0) 2025.01.10