Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var catBreed, catGender string
- fmt.Scanln(&catBreed)
- fmt.Scanln(&catGender)
- breedYears := 0
- switch catBreed {
- case "Siberian":
- breedYears = 11
- case "American Shorthair":
- breedYears = 12
- case "British Shorthair":
- breedYears = 13
- case "Persian":
- breedYears = 14
- case "Siamese":
- breedYears = 15
- case "Ragdoll":
- breedYears = 16
- }
- if catGender == "f" {
- breedYears++
- }
- if breedYears > 0 {
- fmt.Printf("%d cat months", breedYears * 2)
- } else {
- fmt.Printf("%s is invalid cat!", catBreed)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement