Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tuples

Creating Tuples

변수 좌표 = (10, 20)
변수 사람 = ("홍길동", 30, 참)

Access by Index

출력(좌표.0)    // 10
출력(좌표.1)    // 20
출력(사람.0)    // 홍길동

As Return Type

함수 최소최대(arr: [정수]) -> (정수, 정수) {
    변수 최소 = arr[0]
    변수 최대 = arr[0]
    반복 v 안에서 arr {
        만약 v < 최소 이면 { 최소 = v }
        만약 v > 최대 이면 { 최대 = v }
    }
    반환 (최소, 최대)
}

변수 결과 = 최소최대([5, 1, 9, 3, 7])
출력(형식("최소: {0}, 최대: {1}", 결과.0, 결과.1))