https://www.acmicpc.net/problem/6840
6840번: Who is in the middle?
In the story Goldilocks and the Three Bears, each bear had a bowl of porridge to eat while sitting at his/her favourite chair. What the story didn’t tell us is that Goldilocks moved the bowls around on the table, so the bowls were not at the right seats
www.acmicpc.net
코드 :
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int arr[5];
for(int i=0; i<3; i++){
cin >> arr[i];
}
sort(arr,arr+3);
cout << arr[1] << '\n';
}
'PS_Baekjoon' 카테고리의 다른 글
[백준 C++] 7595번 : Triangles (0) | 2023.04.29 |
---|---|
[백준 C++] 6763번 : Speed fines are not fine! (0) | 2023.04.28 |
[백준 C++] 6749번 : Next in line (1) | 2023.04.27 |
[백준 C++] 5717번 : 상근이의 친구들 (0) | 2023.04.26 |
[백준 C++] 4470번 : 줄번호 (0) | 2023.04.25 |