Skip to content · ⁨본문 바로가기⁩

Count up to five · ⁨5까지 세기⁩

English

Count up to five

Use a while loop to print 1 to 5, one per line. Start n at 1.

Counting up needs n = n + 1 instead of n - 1, and a question that stops at the right place. n <= 5 lets 5 through; n < 5 would stop one early.

한국어

5까지 세기

while 루프를 사용하여 1부터 5까지 각 줄 하나씩 출력합니다. n를 1로 시작합니다.

세기는 n = n + 1이 필요하며, n - 1 대신 appropriate한 조건이 필요합니다. n <= 5는 5을 통과하게 하지만, n < 5는 한 단계 일찍 멈출 것입니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP