Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._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.                 int price = int.Parse(Console.ReadLine());
  14.  
  15.                 for (int counter = 0; counter < price; counter++)
  16.                 {
  17.                     int money = int.Parse(Console.ReadLine());
  18.                     counter += money;
  19.  
  20.                 }
  21.                
  22.                 Console.WriteLine($"Going to {destination}!");
  23.                 destination = Console.ReadLine();
  24.             }
  25.         }
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement