update book code

This commit is contained in:
Unknwon
2015-03-03 12:25:25 -05:00
parent b8c82ba4e5
commit eab1d98ba8
465 changed files with 15392 additions and 1572 deletions

32
eBook/exercises/chapter_5/multiple_for.go Normal file → Executable file
View File

@@ -1,17 +1,17 @@
// multiple_for.go
package main
import "fmt"
func main() {
//multiple initialization; a consolidated bool expression with && and ||; multiple incrementation
for i, j, s := 0, 5, "a"; i < 3 && j < 100 && s != "aaaaa"; i, j, s = i+1,
j+1, s + "a" {
fmt.Println("Value of i, j, s:", i, j, s)
}
}
/* Output:
Value of i, j, s: 0 5 a
Value of i, j, s: 1 6 aa
Value of i, j, s: 2 7 aaa
// multiple_for.go
package main
import "fmt"
func main() {
//multiple initialization; a consolidated bool expression with && and ||; multiple incrementation
for i, j, s := 0, 5, "a"; i < 3 && j < 100 && s != "aaaaa"; i, j, s = i+1,
j+1, s + "a" {
fmt.Println("Value of i, j, s:", i, j, s)
}
}
/* Output:
Value of i, j, s: 0 5 a
Value of i, j, s: 1 6 aa
Value of i, j, s: 2 7 aaa
*/