Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var product string
- fmt.Scanln(&product)
- switch (product) {
- case "banana", "apple", "kiwi", "cherry", "lemon", "grapes":
- fmt.Println("fruit")
- case "tomato", "cucumber", "pepper", "carrot":
- fmt.Println("vegetable")
- default:
- fmt.Println("unknown")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement