Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Everest
- {
- class Program
- {
- static void Main(string[] args)
- {
- int top = 8848;
- int progress = 5364;
- int countDni = 1;
- string simbol = "";
- while (progress < top && countDni < 6 && (simbol = Console.ReadLine()) != "END")
- {
- if (simbol == "Yes")
- {
- countDni++;
- }
- int distance = int.Parse(Console.ReadLine());
- if (countDni < 6)
- {
- progress += distance;
- }
- }
- if (progress >= top)
- {
- Console.WriteLine($"Goal reached for {countDni} days!");
- }
- else
- {
- Console.WriteLine("Failed!");
- Console.WriteLine(progress);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement