백준 10817 c

magicdrill·2024년 3월 27일
0

백준 문제풀이

목록 보기
217/655

백준 10817 c

#include <stdio.h>
#pragma warning (disable:4996)

int main(void)
{
	int A, B, C;
	int second_max;

	scanf("%d %d %d", &A, &B, &C);
	if (A >= B)
	{
		if (A >= C)
		{
			if (C >= B)
			{
				second_max = C;
			}
			else//C < B
			{
				second_max = B;
			}
		}
		else//A < C
		{
			second_max = A;
		}
	}
	else//A < B
	{
		if (B >= C)
		{
			if (A <= C)
			{
				second_max = C;
			}
			else// A > C
			{
				second_max = A;
			}
		}
		else// B < C
		{
			second_max = B;
		}
	}

	printf("%d\n", second_max);

	return 0;
}

0개의 댓글