45 Star 130 Fork 53

Apocalypse / c2go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
14.go 284 Bytes
一键复制 编辑 原始数据 按行查看 历史
ZenQy 提交于 2015-03-29 18:12 . last push
//求 100 之内的素数
package main
import (
"fmt"
"math"
)
func main() {
for i := 2; i <= 100; i++ {
prime, mid := true, int(math.Sqrt(float64(i)))
for j := 2; j <= mid; j++ {
if i%j == 0 {
prime = false
break
}
}
if prime {
fmt.Println(i)
}
}
}
Go
1
https://gitee.com/justin.qin/c2go.git
git@gitee.com:justin.qin/c2go.git
justin.qin
c2go
c2go
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891