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

@@ -10,7 +10,7 @@ public class iteration {
/* for ループ */
static int forLoop(int n) {
int res = 0;
// 1, 2, ..., n-1, n の合計をループ計算
// 1, 2, ..., n-1, n を順に加算する
for (int i = 1; i <= n; i++) {
res += i;
}
@@ -20,35 +20,35 @@ public class iteration {
/* while ループ */
static int whileLoop(int n) {
int res = 0;
int i = 1; // 条件変数を初期化
// 1, 2, ..., n-1, n の合計をループ計算
int i = 1; // 条件変数を初期化する
// 1, 2, ..., n-1, n を順に加算する
while (i <= n) {
res += i;
i++; // 条件変数を更新
i++; // 条件変数を更新する
}
return res;
}
/* while ループ2つの更新) */
/* while ループ2更新) */
static int whileLoopII(int n) {
int res = 0;
int i = 1; // 条件変数を初期化
// 1, 4, 10, ... の合計をループ計算
int i = 1; // 条件変数を初期化する
// 1, 4, 10, ... を順に加算する
while (i <= n) {
res += i;
// 条件変数を更新
// 条件変数を更新する
i++;
i *= 2;
}
return res;
}
/* 2重 for ループ */
/* 重 for ループ */
static String nestedForLoop(int n) {
StringBuilder res = new StringBuilder();
// ループ i = 1, 2, ..., n-1, n
// i = 1, 2, ..., n-1, n とループする
for (int i = 1; i <= n; i++) {
// ループ j = 1, 2, ..., n-1, n
// j = 1, 2, ..., n-1, n とループする
for (int j = 1; j <= n; j++) {
res.append("(" + i + ", " + j + "), ");
}
@@ -56,7 +56,7 @@ public class iteration {
return res.toString();
}
/* ドライバーコード */
/* Driver Code */
public static void main(String[] args) {
int n = 5;
int res;
@@ -68,9 +68,9 @@ public class iteration {
System.out.println("\nwhile ループの合計結果 res = " + res);
res = whileLoopII(n);
System.out.println("\nwhile ループ2つの更新)の合計結果 res = " + res);
System.out.println("\nwhile ループ2更新)の合計結果 res = " + res);
String resStr = nestedForLoop(n);
System.out.println("\n2重 for ループ走査結果 = " + resStr);
System.out.println("\n重 for ループ走査結果 " + resStr);
}
}
}