정수 세개가 한 줄에 입력되고, 그걸 정렬해서 2번째 원소를 출력해주면 되는 간단한 문제이다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
using System.IO;
using System.Text;
using System.Linq;
using System.Reflection.PortableExecutable;
namespace 연습장
{
internal class Program
{
static void Main(string[] args)
{
string[] arr = Console.ReadLine().Split();
int[] num = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
num[i] = int.Parse(arr[i]);
Array.Sort(num);
Console.WriteLine(num[1]);
}
}
}
|
cs |

'하루 한 접시' 카테고리의 다른 글
[백준] 1427번: 소트인사이드 [C#] (0) | 2024.03.22 |
---|---|
[백준] 2587번: 대표값2 [C#] (0) | 2024.03.21 |
[백준] 11650번: 좌표 정렬하기 [C#] (0) | 2024.03.21 |
[백준] 11399번: ATM [C#] (0) | 2024.03.21 |
[백준] 1181번: 단어 정렬하기 [C#] (0) | 2024.03.20 |