add: array exercises

This commit is contained in:
Inanc Gumus
2018-12-05 15:02:03 +03:00
parent 25c15716b6
commit 91e17cbeb3
27 changed files with 690 additions and 113 deletions

View File

@ -0,0 +1,27 @@
package main
// ---------------------------------------------------------
// EXERCISE: Fix
//
// 1. Uncomment the code
// 2. And fix the problems
// 3. BONUS: Simplify the code
// ---------------------------------------------------------
func main() {
// var names [3]string = [3]string{
// "Einstein" "Shepard"
// "Tesla"
// }
// var books [5]string = [5]string{
// "Kafka's Revenge",
// "Stay Golden",
// "",
// "",
// ""
// }
// fmt.Printf("%q\n", names)
// fmt.Printf("%q\n", books)
}

View File

@ -0,0 +1,11 @@
package main
import "fmt"
func main() {
names := [...]string{"Einstein", "Shepard", "Tesla"}
books := [5]string{"Kafka's Revenge", "Stay Golden"}
fmt.Printf("%q\n", names)
fmt.Printf("%q\n", books)
}