add: unfinished code. people are having problems
This commit is contained in:
36
14-arrays/exercises/01-declare-empty/main.go
Normal file
36
14-arrays/exercises/01-declare-empty/main.go
Normal file
@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE: Declare empty arrays
|
||||
//
|
||||
// 1. Declare and printf the following arrays:
|
||||
//
|
||||
// 1. A string array with 4 items
|
||||
// 2. An int array 5 items
|
||||
// 3. A byte array with 5 items
|
||||
// 4. A float64 array with 1 item
|
||||
// 5. A bool array with 4 items
|
||||
// 6. A byte array without any items
|
||||
//
|
||||
// 2. Print the types of the previous arrays.
|
||||
//
|
||||
// NOTE
|
||||
// You should use printf with #v verb.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// names : [4]string{"", "", "", ""}
|
||||
// distances: [5]int{0, 0, 0, 0, 0}
|
||||
// data : [5]uint8{0x0, 0x0, 0x0, 0x0, 0x0}
|
||||
// ratios : [1]float64{0}
|
||||
// switches : [4]bool{false, false, false, false}
|
||||
// zero : [0]bool{}
|
||||
// names : [4]string
|
||||
// distances: [5]int
|
||||
// data : [5]uint8
|
||||
// ratios : [1]float64
|
||||
// switches : [4]bool
|
||||
// zero : [0]bool
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
}
|
Reference in New Issue
Block a user