Advertisement
Spocoman

03. Animal Type

Sep 17th, 2024
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.32 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var animal string
  6.     fmt.Scanln(&animal)
  7.    
  8.     switch (animal) {
  9.         case "dog":
  10.             fmt.Println("mammal")
  11.         case "crocodile", "tortoise", "snake":
  12.             fmt.Println("reptile")
  13.         default:
  14.             fmt.Println("unknown")
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement