Re-translate the Japanese version (#1871)

* Retranslate Japanese docs with GPT-5.4

* Retranslate Japanese code with GPT-5.4
This commit is contained in:
Yudong Jin
2026-03-30 07:30:15 +08:00
committed by GitHub
parent fe6443235b
commit d7b2277d2b
1444 changed files with 83312 additions and 8363 deletions

View File

@@ -6,44 +6,44 @@ Author: krahets (krahets@163.com)
def for_loop(n: int) -> int:
"""forループ"""
"""for ループ"""
res = 0
# 1, 2, ..., n-1, n の合計をループ
# 1, 2, ..., n-1, n を順に加算する
for i in range(1, n + 1):
res += i
return res
def while_loop(n: int) -> int:
"""whileループ"""
"""while ループ"""
res = 0
i = 1 # 条件変数を初期化
# 1, 2, ..., n-1, n の合計をループ
i = 1 # 条件変数を初期化する
# 1, 2, ..., n-1, n を順に加算する
while i <= n:
res += i
i += 1 # 条件変数を更新
i += 1 # 条件変数を更新する
return res
def while_loop_ii(n: int) -> int:
"""whileループ2つの更新)"""
"""while ループ2更新)"""
res = 0
i = 1 # 条件変数を初期化
# 1, 4, 10, ... の合計をループ
i = 1 # 条件変数を初期化する
# 1, 4, 10, ... を順に加算する
while i <= n:
res += i
# 条件変数を更新
# 条件変数を更新する
i += 1
i *= 2
return res
def nested_for_loop(n: int) -> str:
"""二重forループ"""
"""二重 for ループ"""
res = ""
# i = 1, 2, ..., n-1, n ループ
# i = 1, 2, ..., n-1, n ループする
for i in range(1, n + 1):
# j = 1, 2, ..., n-1, n ループ
# j = 1, 2, ..., n-1, n ループする
for j in range(1, n + 1):
res += f"({i}, {j}), "
return res
@@ -53,13 +53,13 @@ def nested_for_loop(n: int) -> str:
if __name__ == "__main__":
n = 5
res = for_loop(n)
print(f"\nforループの合計結果 res = {res}")
print(f"\nfor ループの合計結果 res = {res}")
res = while_loop(n)
print(f"\nwhileループの合計結果 res = {res}")
print(f"\nwhile ループの合計結果 res = {res}")
res = while_loop_ii(n)
print(f"\nwhileループ2つの更新)の合計結果 res = {res}")
print(f"\nwhile ループ2更新)の合計結果 res = {res}")
res = nested_for_loop(n)
print(f"\n二重forループの走査結果 {res}")
print(f"\n二重 for ループの走査結果 {res}")