백준 알고리즘
[백준 알고리즘] 10817번 세 수
ChocoPeanut
2017. 5. 20. 15:28
세 수
세 정수 A, B, C가 주어진다. 이 때, 두 번째로 큰 정수를 출력하는 프로그램을 작성하시오.
#include <iostream>
using namespace std;
int main()
{
int x;
int y;
int z;
cin >> x;
cin >> y;
cin >> z;
if (x>=y){
if(x<=z){
cout << x << endl;
}
else{
if (y<=z)
cout << z << endl;
else {
cout << y << endl;
}
}
}
else {
if (y<=z){
cout << y << endl;
}
else{
if (x<=z){
cout << z << endl;
}
else {
cout << x << endl;
}
}
}
}