1
2
3
4
5
6
7
8
fun arithmetic(x: Int, y: Int, calculate: (Int, Int) -> Int): Int {
        return calculate(x, y)
    }
 
    println("계산값 : " + arithmetic(5, 10, {x, y -> x + y}))
    println("계산값 : " + arithmetic(5, 10, {x, y -> x - y}))
    println("계산값 : " + arithmetic(5, 10, {x, y -> x * y}))
    println("계산값 : " + arithmetic(5, 10, {x, y -> x / y}))
cs


사칙연산 예제보고서 벌써 벽느끼는중임