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