반복문·11 / 22

while문

조건이 참인 동안 반복합니다.

int n = 3;
while (n > 0) {
    System.out.println(n);
    n--;
}

할 일

n이 0보다 큰 동안 출력하고 1씩 줄이세요

막혔나요?
코드 에디터