Krasimir_Slavov

Untitled

Dec 1st, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exam_Everest
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int mClimbed = 0;
  14. string stay = string.Empty;
  15.  
  16. int daysCount = 1;
  17. int distance = 0;
  18.  
  19. while ((stay = Console.ReadLine()) != "END" && distance < 3484 && daysCount <= 5)
  20. {
  21. if (stay == "Yes") daysCount++;
  22. mClimbed = int.Parse(Console.ReadLine());
  23. distance += mClimbed;
  24. }
  25. distance += 5364;
  26.  
  27. if (distance >= 8848) Console.WriteLine($"Goal reached for {daysCount} days!");
  28. else Console.WriteLine($"Failed!\n{distance}");
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment