Double until it passes 100 · 100을 넘을 때까지 두 배로 늘리기
Double until it passes 100
n starts at 1. Keep doubling it while it is 100 or less. Store the first value over 100 in n.
Here the value being tested is the value being changed, so the loop needs no separate counter. It stops the moment the question turns false — and n keeps the value that made it false.
100을 넘을 때까지 두 배하기
n는 1에서 시작합니다. 값이 100 이하일 때 두 배씩 계속 늘리세요. 첫 번째 결과를 100 위에 저장하여 n에 넣으세요.
여기서 테스트되는 값이 동시에 변경되는 값이기 때문에 별도의 카운터가 필요 없습니다. 질문이 거짓이 되는 순간 루프가 멈추며, n는 이를 거짓으로 만든 값을 유지합니다.
n starts at 1. Keep doubling it while it is 100 or less. Store the first value over 100 in n. · n는 1에서 시작합니다. 값이 100 이하일 때 두 배씩 계속 늘리세요. 첫 번째 결과를 100 위에 저장하여 n에 넣으세요.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.