Short Cake
8PM - Animal Crossing Wild World

사생활 보호 설정

https://gamjia.tistory.com

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;

}
​

'BaekJoon' 카테고리의 다른 글

2941번 크로아티아 알파벳  (0) 2023.03.29
5622번 다이얼  (0) 2023.03.27
1152번 단어의 개수  (0) 2023.03.27
1157번 단어 공부  (0) 2023.03.27
2675번 문자열 반복  (0) 2023.03.27