Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var animal string
- fmt.Scanln(&animal)
- switch (animal) {
- case "dog":
- fmt.Println("mammal")
- case "crocodile", "tortoise", "snake":
- fmt.Println("reptile")
- default:
- fmt.Println("unknown")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement