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