ZhangZhihui's Blog  

 

package main

import "fmt"

func main() {
    var n int

    for {
        n++

        if n%2 == 0 {
            continue
        }

        if n > 10 {
            break
        }
        fmt.Println(n)
    }
}

 

frank@ZZHPC:~/zproject/GO-BASICS$ go run .
1
3
5
7
9

 

posted on 2026-03-04 14:44  ZhangZhihuiAAA  阅读(51)  评论(0)    收藏  举报