Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var sleep string
- fmt.Scanln(&sleep)
- var daylyHeight int
- reachedHeight := 5364
- days := 1
- for reachedHeight < 8848 && sleep != "END" {
- if sleep == "Yes" {
- days++
- if days == 6 {
- break
- }
- }
- fmt.Scanln(&daylyHeight)
- reachedHeight += daylyHeight
- fmt.Scanln(&sleep)
- }
- if reachedHeight >= 8848 {
- fmt.Printf("Goal reached for %d days!\n", days)
- } else {
- fmt.Printf("Failed!\n%d\n", reachedHeight)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement