Advertisement
Spocoman

04. Personal Titles

Sep 17th, 2024
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.43 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var age float32
  6.     fmt.Scanln(&age)
  7.    
  8.     var gender string
  9.     fmt.Scanln(&gender)
  10.    
  11.     if (gender == "m") {
  12.         if (age < 16) {
  13.             fmt.Println("Master")
  14.         } else {
  15.             fmt.Println("Mr.")
  16.         }
  17.     } else {
  18.         if (age < 16) {
  19.             fmt.Println("Miss")
  20.         } else {
  21.             fmt.Println("Ms.")
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement