Guest User

Untitled

a guest
Jan 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6. arr := []string{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"}
  7. numbers := arr[26:36]
  8. letters := arr[0:26]
  9. fmt.Println(letters)
  10. vowels := []string{arr[0],arr[4],arr[8],arr[14],arr[20]}
  11. fmt.Println(arr)
  12. fmt.Println(numbers)
  13. fmt.Println(vowels)
  14. consonants := []string{arr[1],arr[2],arr[3],arr[5],arr[6],arr[7],arr[9],arr[10],arr[11],arr[12],arr[13],arr[15],arr[16],arr[17],arr[18],arr[19],arr[21],arr[22],arr[23],arr[24],arr[25]}
  15. fmt.Println(consonants)
  16. odds := []string{numbers[1],numbers[3],numbers[5],numbers[7],numbers[9]}
  17. fmt.Println(odds)
  18. evens := []string{numbers[0],numbers[2],numbers[4],numbers[6],numbers[8]}
  19. fmt.Println(evens)
  20. }
  21.  
  22. C:UsersOwnerDesktop>go run Array.go
  23. [a b c d e f g h i j k l m n o p q r s t u v w x y z]
  24. [a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9]
  25. [0 1 2 3 4 5 6 7 8 9]
  26. [a e i o u]
  27. [b c d f g h j k l m n p q r s t v w x y z]
  28. [1 3 5 7 9]
  29. [0 2 4 6 8]
Add Comment
Please, Sign In to add comment