6840
#include <stdio.h>
#include <stdlib.h>
// 오름차순
int cmp(const void *a, const void *b){
return *(int *)a-*(int *)b;
}
int main(void){
// 비교할 숫자 3개 입력
int num[3] = {0};
for(int i = 0; i < 3; i++){
scanf("%d", &num[i]);
}
// 정렬
qsort(num, 3, sizeof(int), cmp);
// 중간값 출력
printf("%d", num[1]);
return 0;
}

'백준' 카테고리의 다른 글
| [ 백준 / C ] 11580번 : Footprint (0) | 2026.02.03 |
|---|---|
| [ 백준 / C ] 10926번 : ??! (0) | 2026.02.02 |
| [ 백준 / C ] 11346번 : Cornell Party - Retry (0) | 2026.01.29 |
| [ 백준 / C ] 9507번 : Generations of Tribbles (0) | 2026.01.28 |
| [ 백준 / C ] 16244번 : Spaceship (0) | 2026.01.27 |