기록장
TODAY TOTAL
[BOJ] 10988번 : 팰린드롬인지 확인하기

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


 구현 코드 

#include<bits/stdc++.h>
using namespace std;

int main()
{
   ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
   string rev;
   cin>>rev;
   string str = rev;
   reverse(rev.begin(),rev.end());
   if(str == rev) cout<<"1";
   else cout<<"0";
   
    return 0;
}

 

 

 리뷰 

reverse 함수를 알고있다면 간단하게 해결 가능

  Comments