Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace travelling
- {
- class Program
- {
- static void Main()
- {
- string Destrination = Console.ReadLine();
- int Budget_Minimum = int.Parse(Console.ReadLine());
- //--------------------------------------
- //--------------------------------------
- int Saved_Money = 0;
- // France Portugal Spain Egypt
- int Destinations_Count = 0;
- //--------------------------------------
- //--------------------------------------
- while (true)
- {
- string input = Console.ReadLine();
- int paycheck = Convert.ToInt32(input);
- Saved_Money += paycheck;
- if (paycheck == Budget_Minimum)
- {
- Console.WriteLine($"Going to {Destrination}!");
- Destinations_Count++;
- if (Destinations_Count == 4)
- {
- Console.WriteLine("End"); break;
- }
- else
- {
- Destrination = Console.ReadLine();
- Budget_Minimum = int.Parse(Console.ReadLine());
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment