Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Traveling
- {
- class Program
- {
- static void Main(string[] args)
- {
- string destination = string.Empty;
- string input = string.Empty;
- double minimalBudget = 0;
- double saved = 0;
- for (; input != "End";)
- {
- saved = 0;
- input = Console.ReadLine();
- if (input == "End")
- {
- break;
- }
- minimalBudget = double.Parse(Console.ReadLine());
- for (; saved < minimalBudget ;) //saving
- {
- saved += double.Parse(Console.ReadLine());
- }
- Console.WriteLine($"Going to {input}!");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment