반응형
문제 출처
https://www.acmicpc.net/problem/2908
소스코드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include <iostream> #include <vector> #include <algorithm> using namespace std; int reverse(int num) { int a = num / 100; int b = (num % 100) / 10; int c = num % 10; int ret = c * 100 + b * 10 + a; return ret; } int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; a = reverse(a); b = reverse(b); if (a > b) cout << a; else cout << b; return 0; } | cs |
반응형
'Algorithm' 카테고리의 다른 글
[BOJ 2941] 크로아티아 알파벳 (0) | 2019.01.07 |
---|---|
[BOJ 1316] 그룹 단어 체크 (0) | 2019.01.07 |
[BOJ 10809] 알파벳 찾기 (0) | 2019.01.07 |
[BOJ_11724] 연결 요소의 개수 (0) | 2019.01.07 |
[카카오 2019] 코딩테스트 - 무지의 먹방 라이브 (0) | 2019.01.07 |