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