Advertisement
RoshHoul

Task1 07

Sep 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 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.  
  24.  
  25.             Console.WriteLine(min);
  26.             Console.ReadKey();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement