Advertisement
Spocoman

05. Travelling

Sep 24th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.40 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var destination string
  7.     fmt.Scanln(&destination)
  8.  
  9.     var budget, currentSum float64
  10.  
  11.     for ; destination != "End"; {
  12.         fmt.Scanln(& budget)
  13.         for ; budget > 0; {
  14.             fmt.Scanln(&currentSum)
  15.             budget -= currentSum
  16.         }
  17.         fmt.Printf("Going to %s!\n", destination)
  18.         fmt.Scanln(&destination)
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement