![[C++] 백준 5단계 - 2908번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbaPyPn%2Fbtr7n06XWdR%2FAAAAAAAAAAAAAAAAAAAAAPd0mgtq5tpH4eJQCHYtPo4Lxf-3drZb4R-gUeYBKn4V%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DDBJYEca5g0eLMce1Biyu7TycgtM%253D)
[C++] 백준 5단계 - 2908번 문제자료구조 & 알고리즘/BOJ2023. 4. 5. 00:47
Table of Contents
문제설명
소스코드
#include<iostream>
#include <string>
using namespace std;
int main()
{
string a; string b;
cin >> a >> b;
for (int i = 0; i < 1; ++i)
{
string tmp = " ";
tmp[i] = a[2 - i];
a[2 - i] = a[i];
a[i] = tmp[i];
tmp[i] = b[2 - i];
b[2 - i] = b[i];
b[i] = tmp[i];
}
int c = stoi(a); int d = stoi(b);
c > d ? cout << c : cout << d;
}
'자료구조 & 알고리즘 > BOJ' 카테고리의 다른 글
[C++] 백준 - 27433번 문제 (팩토리얼 2)(재귀 사용X) (0) | 2023.04.06 |
---|---|
[C++] 백준 5단계 - 5622번 문제 (0) | 2023.04.05 |
[C++] 백준 5단계 - 1152번 문제 (0) | 2023.04.05 |
[C++] 백준 5단계 - 2675번 문제 (0) | 2023.04.03 |
[C++] 백준 5단계 - 10809번 문제 (0) | 2023.04.03 |