Advertisement
Spocoman

Everest

Oct 8th, 2024
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.60 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var sleep string
  7.     fmt.Scanln(&sleep)
  8.  
  9.     var daylyHeight int
  10.    
  11.     reachedHeight := 5364
  12.     days := 1
  13.  
  14.     for reachedHeight < 8848 && sleep != "END" {
  15.         if sleep == "Yes" {
  16.             days++
  17.             if days == 6 {
  18.                 break
  19.             }
  20.         }
  21.         fmt.Scanln(&daylyHeight)
  22.         reachedHeight += daylyHeight
  23.         fmt.Scanln(&sleep)
  24.     }
  25.  
  26.     if reachedHeight >= 8848 {
  27.         fmt.Printf("Goal reached for %d days!\n", days)
  28.     } else {
  29.         fmt.Printf("Failed!\n%d\n", reachedHeight)
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement