Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05.Travelling
- {
- class Travelling
- {
- static void Main(string[] args)
- {
- string destination = string.Empty;
- double money = 0;
- while (true)
- {
- destination = Console.ReadLine();
- if (destination == "End")
- {
- break;
- }
- double neededMoney = double.Parse(Console.ReadLine());
- double savedMoney = 0;
- while (savedMoney < neededMoney)
- {
- money = double.Parse(Console.ReadLine());
- savedMoney += money;
- }
- Console.WriteLine($"Going to {destination}!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement