Home 백준 - 10818 최소, 최대
Post
Cancel

백준 - 10818 최소, 최대

문제

10818 최소, 최대

screencapture

kotlin code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import java.util.*
import kotlin.collections.ArrayList

fun main(args: Array<String>) {
    q10818();
}

fun q10818() = with(Scanner(System.`in`)) {
    val list = ArrayList<Int>()
    for(i in 0 until nextInt())
        list.add(nextInt())

    println(list.minOf { it }.toString() + " " + list.maxOf { it }.toString())
}
This post is licensed under CC BY 4.0 by the author.

백준 - 2562 최댓값

백준 - 10951 A+B - 4