Files
hello-algo/ja/codes/go/chapter_computational_complexity/iteration_test.go
Yudong Jin 7257641e0e Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese

* Fit Japanese homepage labels and localize heading permalinks

* Point Japanese contribution instructions to the Japanese preview

* Replace locale conditionals with multilingual UI tables
2026-10-30 02:12:26 +08:00

27 lines
591 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// File: iteration_test.go
// Created Time: 2023-08-28
// Author: Reanon (793584285@qq.com)
package chapter_computational_complexity
import (
"fmt"
"testing"
)
/* 実行用コード */
func TestIteration(t *testing.T) {
n := 5
res := forLoop(n)
fmt.Println("\nfor ループで求めた和 res = ", res)
res = whileLoop(n)
fmt.Println("\nwhile ループで求めた和 res = ", res)
res = whileLoopII(n)
fmt.Println("\nwhile ループ(2 回の更新)で求めた和 res = ", res)
resStr := nestedForLoop(n)
fmt.Println("\n二重 for ループの走査結果 ", resStr)
}