Advertisement
Guest User

Untitled

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