사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
2908번 상수
GamJia 2023. 3. 27. 09:15
단계별로 풀어보기 - 문자열 - 7단계
https://www.acmicpc.net/problem/2908
#include <iostream> #include <algorithm> // reverse 사용을 위해 헤더 작성 #include <string> using namespace std; int main() { string A,B; cin>>A>>B; int x,y; reverse(A.begin(),A.end()); reverse(B.begin(),B.end()); x = atoi(A.c_str()); // int형으로 변환 y = atoi(B.c_str()); if (x >= y) { cout << x; } else { cout << y; } return 0; }