728x90
출처-https://www.acmicpc.net/problem/10817
728x90
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
int med=0;
if (((a>=b)&&(a<=c))||((a<=b)&&(a>=c)))
med=a;
else if (((b>=a)&&(b<=c))||((b<=a)&&(b>=c)))
med=b;
else
med=c;
System.out.println(med);
}
}
728x90
'Problem Solving > BOJ' 카테고리의 다른 글
[백준, BOJ 10996] 별 찍기 - 21 (java) (0) | 2020.08.25 |
---|---|
[백준, BOJ 2523] 별 찍기 - 13 (java) (0) | 2020.08.25 |
[백준, BOJ 5543] 상근날드 (java) (0) | 2020.08.25 |
[백준, BOJ 10039] 평균 점수 (java) (0) | 2020.08.25 |
[백준, BOJ 10953] A+B - 6 (java) (0) | 2020.08.21 |