mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-02 03:05:24 +08:00
* feat(ko): add the complete Korean online edition * Use UTF-8 for Python CI output on Windows * Remove print-book promotion from the Korean site * fix(ko): preserve emphasis before Korean particles
27 lines
590 B
Go
27 lines
590 B
Go
// File: iteration_test.go
|
|
// Created Time: 2023-08-28
|
|
// Author: Reanon ([email protected])
|
|
|
|
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 반복문(두 번 갱신)으로 구한 합 res = ", res)
|
|
|
|
resStr := nestedForLoop(n)
|
|
fmt.Println("\n이중 for 반복문의 순회 결과 ", resStr)
|
|
}
|