#include <stdio.h>
#include <string.h>
#define SIZE 3
int main(void)
{
char S1[SIZE];
char S2[SIZE];
char zero = '0';
int a1;
int a2;
a1 = 0;
a2 = 0;
char temp;
scanf("%s %s", &S1, &S2);
temp = S1[0];
S1[0] = S1[2];
S1[2] = temp;
temp = S2[0];
S2[0] = S2[2];
S2[2] = temp;
for (int i = 0; i < SIZE; i++)
{
a1 = (a1 * 10) + (S1[i] - zero);
a2 = (a2 * 10) + (S2[i] - zero);
}
if (a1 >= a2)
{
printf("%d\n", a1);
}
else
{
printf("%d\n", a2);
}
}
'코딩테스트 > C' 카테고리의 다른 글
백준 11718번 그대로 출력하기 (0) | 2024.06.30 |
---|---|
백준 5622번 다이얼 (1) | 2024.06.30 |
백준 2675번 문자열 반복 (0) | 2024.06.29 |
백준 10809번 알파벳 찾기 (0) | 2024.06.29 |
백준 11654번 아스키 코드 (0) | 2024.06.29 |