fix: printf exercises

* Improvements to exercise solutions
* Fix grammar in exercise
This commit is contained in:
Paul Waldmann
2018-11-17 21:58:29 +08:00
committed by Inanc Gumus
parent d4a81f94e9
commit 9806e01284
6 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ package main
// Print your age using Prinft // Print your age using Prinft
// //
// EXPECTED OUTPUT // EXPECTED OUTPUT
// My age is 30 years old. // I'm 30 years old.
// //
// NOTE // NOTE
// You should change 30 to your age, of course. // You should change 30 to your age, of course.

View File

@ -10,5 +10,5 @@ package main
import "fmt" import "fmt"
func main() { func main() {
fmt.Printf("My age is %d years old.\n", 30) fmt.Printf("I'm %d years old.\n", 30)
} }

View File

@ -10,5 +10,5 @@ package main
import "fmt" import "fmt"
func main() { func main() {
fmt.Printf("Type of %d is %T\n", 3, 3) fmt.Printf("Type of %d is %[1]T\n", 3)
} }

View File

@ -10,5 +10,5 @@ package main
import "fmt" import "fmt"
func main() { func main() {
fmt.Printf("Type of %f is %T\n", 3.14, 3.14) fmt.Printf("Type of %.2f is %[1]T\n", 3.14)
} }

View File

@ -10,5 +10,5 @@ package main
import "fmt" import "fmt"
func main() { func main() {
fmt.Printf("Type of %s is %T\n", "hello", "hello") fmt.Printf("Type of %s is %[1]T\n", "hello")
} }

View File

@ -10,5 +10,5 @@ package main
import "fmt" import "fmt"
func main() { func main() {
fmt.Printf("Type of %t is %T\n", true, true) fmt.Printf("Type of %t is %[1]T\n", true)
} }