docs: add Japanese translate documents (#1812)

* docs: add Japanese documents (`ja/docs`)

* docs: add Japanese documents (`ja/codes`)

* docs: add Japanese documents

* Remove pythontutor blocks in ja/

* Add an empty at the end of each markdown file.

* Add the missing figures (use the English version temporarily).

* Add index.md for Japanese version.

* Add index.html for Japanese version.

* Add missing index.assets

* Fix backtracking_algorithm.md for Japanese version.

* Add avatar_eltociear.jpg. Fix image links on the Japanese landing page.

* Add the Japanese banner.

---------

Co-authored-by: krahets <krahets@163.com>
This commit is contained in:
Ikko Eltociear Ashimine
2025-10-17 06:04:43 +09:00
committed by GitHub
parent 2487a27036
commit 954c45864b
886 changed files with 33569 additions and 0 deletions

View File

@ -0,0 +1,65 @@
"""
File: iteration.py
Created Time: 2023-08-24
Author: krahets (krahets@163.com)
"""
def for_loop(n: int) -> int:
"""forループ"""
res = 0
# 1, 2, ..., n-1, n の合計をループ
for i in range(1, n + 1):
res += i
return res
def while_loop(n: int) -> int:
"""whileループ"""
res = 0
i = 1 # 条件変数を初期化
# 1, 2, ..., n-1, n の合計をループ
while i <= n:
res += i
i += 1 # 条件変数を更新
return res
def while_loop_ii(n: int) -> int:
"""whileループ2つの更新"""
res = 0
i = 1 # 条件変数を初期化
# 1, 4, 10, ... の合計をループ
while i <= n:
res += i
# 条件変数を更新
i += 1
i *= 2
return res
def nested_for_loop(n: int) -> str:
"""二重forループ"""
res = ""
# i = 1, 2, ..., n-1, n をループ
for i in range(1, n + 1):
# j = 1, 2, ..., n-1, n をループ
for j in range(1, n + 1):
res += f"({i}, {j}), "
return res
"""Driver Code"""
if __name__ == "__main__":
n = 5
res = for_loop(n)
print(f"\nforループの合計結果 res = {res}")
res = while_loop(n)
print(f"\nwhileループの合計結果 res = {res}")
res = while_loop_ii(n)
print(f"\nwhileループ2つの更新の合計結果 res = {res}")
res = nested_for_loop(n)
print(f"\n二重forループの走査結果 {res}")