Advertisement
LOH_DIMI3

05. Traveling

Oct 19th, 2019
144
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 Moving
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string command;
  10.  
  11.             while ((command = Console.ReadLine()) != "End")
  12.             {
  13.                 int budget = int.Parse(Console.ReadLine());
  14.                 int income = int.Parse(Console.ReadLine());
  15.                 int a = income;
  16.                 for (int i = a; i < budget; i += income)
  17.                 {
  18.                     income = int.Parse(Console.ReadLine());
  19.                 }
  20.                 Console.WriteLine($"Going to {command}!");
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement