45 Star 132 Fork 53

Apocalypse/c2go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
17.go 226 Bytes
一键复制 编辑 原始数据 按行查看 历史
ZenQy 提交于 2015-03-29 18:12 . last push
//将一个数组逆序输出。
package main
import (
"fmt"
)
func main() {
s := []int{1, 2, 3, 4, 5, 6, 7}
lenth := len(s)
for i := 0; i < lenth/2; i++ {
s[i], s[lenth-i-1] = s[lenth-i-1], s[i]
}
fmt.Println(s)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/justin.qin/c2go.git
git@gitee.com:justin.qin/c2go.git
justin.qin
c2go
c2go
master

搜索帮助