Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _06.Travelling
- {
- class Program
- {
- static void Main(string[] args)
- {
- string destination = string.Empty;
- double money = 0;//1 място
- while (true)
- {
- destination = Console.ReadLine();
- if (destination == "End")
- {
- break;
- }
- double neededMoney = double .Parse(Console.ReadLine());//2, 3 място
- double savedMoney = 0;//4 място
- while (savedMoney < neededMoney)
- {
- money = double .Parse(Console.ReadLine());//5 място
- savedMoney += money;
- }
- Console.WriteLine($"Going to {destination}!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment