Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HelloSoftUni
- {
- class Program
- {
- static void Main(string[] args)
- {
- for (int i = 0; ; i++)
- {
- Console.WriteLine("enter the country:");
- string country = Console.ReadLine();
- if (country == "End")
- break;
- Console.WriteLine("enter the price of the journey: ");
- int price = int.Parse(Console.ReadLine());
- int totalSavedMoney = 0;
- for (int j = 0; ; j++)
- {
- int savedMoney = int.Parse(Console.ReadLine());
- totalSavedMoney += savedMoney;
- Console.WriteLine($"savedmoney {totalSavedMoney}");
- if (totalSavedMoney >= price)
- {
- Console.WriteLine($"Going to {country}!");
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement