[go: up one dir, main page]

Advertisement
Spocoman

Cat Life

Oct 4th, 2024
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.74 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var catBreed, catGender string
  7.     fmt.Scanln(&catBreed)
  8.     fmt.Scanln(&catGender)
  9.  
  10.     breedYears := 0
  11.    
  12.     switch catBreed {
  13.         case "Siberian":
  14.             breedYears = 11
  15.         case "American Shorthair":
  16.             breedYears = 12
  17.         case "British Shorthair":
  18.             breedYears = 13
  19.         case "Persian":
  20.             breedYears = 14
  21.         case "Siamese":
  22.             breedYears = 15
  23.         case "Ragdoll":
  24.             breedYears = 16
  25.     }
  26.  
  27.     if catGender == "f" {
  28.         breedYears++
  29.     }
  30.  
  31.     if breedYears > 0 {
  32.         fmt.Printf("%d cat months", breedYears * 2)
  33.     } else {
  34.         fmt.Printf("%s is invalid cat!", catBreed)
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement