package main
import "fmt"
func main(){
sum := 1
for i:=1;i<100;i++ {
sum += i
}
fmt.Println(sum) // 4951
}複製代碼
package main
import "fmt"
func main(){
sum := 1
for ;sum<100; {
sum += sum
}
fmt.Println(sum) //128
}複製代碼
package main
import "fmt"
func main(){
sum := 1
for sum<100 {
sum += sum
}
fmt.Println(sum) //128
}複製代碼
package main
func main(){
for {
}
}複製代碼