mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-03 02:54:22 +00:00
772183705e
* Add Russian docs site baseline * Add Russian localized codebase * Polish Russian code wording * Update ru code translation. * Update code translation and chapter covers. * Fix pythontutor extraction. * Add README and landing page. * placeholder of profiles * Use figures of English version * Remove chapter paperbook
27 lines
730 B
Go
27 lines
730 B
Go
// File: iteration_test.go
|
|
// Created Time: 2023-08-28
|
|
// Author: Reanon (793584285@qq.com)
|
|
|
|
package chapter_computational_complexity
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
/* Driver Code */
|
|
func TestIteration(t *testing.T) {
|
|
n := 5
|
|
res := forLoop(n)
|
|
fmt.Println("\nРезультат суммирования в цикле for res = ", res)
|
|
|
|
res = whileLoop(n)
|
|
fmt.Println("\nРезультат суммирования в цикле while res = ", res)
|
|
|
|
res = whileLoopII(n)
|
|
fmt.Println("\nРезультат суммирования в цикле while (двойное обновление) res = ", res)
|
|
|
|
resStr := nestedForLoop(n)
|
|
fmt.Println("\nРезультат обхода в двойном цикле for ", resStr)
|
|
}
|