Advertisement
nnikolov

Untitled

Mar 18th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Travelling
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string asd = "End";
  10. string destination = "";
  11. int save = 0;
  12.  
  13.  
  14. while (true)
  15. {
  16. destination = Console.ReadLine();
  17.  
  18. if(destination == "End")
  19. {
  20. return;
  21. }
  22. int budget = int.Parse(Console.ReadLine());
  23. for (int saves = 0; saves < budget; saves += save)
  24. {
  25. save = int.Parse(Console.ReadLine());
  26. }
  27.  
  28. Console.WriteLine($"Going to {destination}!");
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement