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

Add up 1 to 100 · ⁨1부터 100까지 더하기⁩

English

Add up 1 to 100

Add every whole number from 1 to 100 and print the result.

This is a running total: start at 0 and add the loop variable on every pass. The starter adds 1 to 10, so you only need to change where the range stops. The young Carl Friedrich Gauss is said to have found this answer in his head by pairing 1 + 100, 2 + 99 and so on.

한국어

1부터 100까지 더하기

1부터 100까지 모든 자연수를 더하고 결과를 출력하십시오.

이는 누적 합계입니다: 0에서 시작하여 매 반복마다 루프 변수를 더하십시오. 초기값은 1을 10에 더하므로, range이 언제 멈출지만 바꾸면 됩니다. 어린 카를 프리드리히 가우스가 이 답을 머리속에서 1 + 100, 2 + 99 등을 짝 지어 찾아냈다는 이야기가 있습니다.

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

IGCSE, A-Level & AP