Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Projects_Creation
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int total = 0;
- while (true)
- {
- string destination = Console.ReadLine();
- if (destination == "End")
- {
- break;
- }
- int minBudget = int.Parse(Console.ReadLine());
- while (true)
- {
- string sum = Console.ReadLine();
- if (sum == "End")
- {
- Console.WriteLine($"Going to {destination}!");
- break;
- }
- total += int.Parse(sum);
- if (total >= minBudget)
- {
- Console.WriteLine($"Going to {destination}!");
- break;
- }
- }
- total = 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement