Chinaunix首页 | 论坛 | 博客
  • 博客访问: 30755
  • 博文数量: 11
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 100
  • 用 户 组: 普通用户
  • 注册时间: 2014-10-19 21:19
文章分类
文章存档

2015年(2)

2014年(9)

我的朋友

分类: 敏捷开发

2014-11-24 21:20:58


点击(此处)折叠或打开

  1. // For
  2. package main

  3. import (
  4.     "fmt"
  5. )

  6. func main() {
  7.     i := 1
  8.     for i <= 3 {
  9.         fmt.Println(i)
  10.         i = i + 1
  11.     }
  12.     //A classic initial/condition/after for loop.
  13.     for j := 7; j <= 9; j++ {
  14.         fmt.Println(j)
  15.     }
  16.     //for without a condition will loop repeatedly until you break out of the loop or return from the enclosing function.
  17.     for {
  18.         fmt.Println("loop")
  19.         break
  20.     }
  21. }
转自
阅读(788) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~