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