Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strconv"
- )
- func main() {
- var kids, adults int
- var input string
- fmt.Scanln(&input)
- for input != "Christmas" {
- years, _ := strconv.Atoi(input)
- if years <= 16 {
- kids++
- } else {
- adults++
- }
- fmt.Scanln(&input)
- }
- fmt.Printf("Number of adults: %d\n", adults)
- fmt.Printf("Number of kids: %d\n", kids)
- fmt.Printf("Money for toys: %d\n", kids * 5)
- fmt.Printf("Money for sweaters: %d\n", adults * 15)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement