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 |
사칙연산 예제보고서 벌써 벽느끼는중임
해당 댓글은 삭제되었습니다.
자바 못하는게 없농