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