RoshHoul

Task1 07

Sep 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int min = 0;
  10.  
  11.             for (int i = 0; i < 3; i++)
  12.             {
  13.                 string userInput = Console.ReadLine();
  14.                 string[] values = userInput.Split(' ');
  15.                 int currentMin = Convert.ToInt32(values[1]) - Convert.ToInt32(values[0]);
  16.  
  17.                 if (currentMin < min || i == 0)
  18.                 {
  19.                     min = currentMin;
  20.                 }
  21.             }
  22.  
  23.             Console.WriteLine(min);
  24.             Console.ReadKey();
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment