Advertisement
Guest User

edited

a guest
Feb 17th, 2020
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Travelling
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string destination = Console.ReadLine();
  10.  
  11.             while (destination != "End")
  12.             {
  13.                 double amount = double.Parse(Console.ReadLine());
  14.                
  15.                 while (amount > 0)
  16.                 {
  17.                     amount -= double.Parse(Console.ReadLine());;
  18.                 }
  19.                 Console.WriteLine($"Going to {destination}!");
  20.                 destination = Console.ReadLine();
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement