Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06._Travelling
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string destination = Console.ReadLine();
  10.  
  11. while (destination != "End")
  12. {
  13. double neededMoney = double.Parse(Console.ReadLine());
  14. double savedMoney = 0;
  15. while (savedMoney < neededMoney)
  16. {
  17. double currentSavedMoney = double.Parse(Console.ReadLine());
  18. savedMoney += currentSavedMoney;
  19. }
  20. destination = Console.ReadLine();
  21. Console.WriteLine($"Going to {destination}!");
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement