Advertisement
Monteso

Min Number

Oct 12th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Min_Number
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int min = int.Parse(Console.ReadLine());
  11.  
  12.             for (int i = 0; n - 1 > i; i++)
  13.             {
  14.                 int currentNumber = int.Parse(Console.ReadLine());
  15.                 if (min > currentNumber)
  16.                 {
  17.                     min = currentNumber;
  18.                 }
  19.             }
  20.             Console.WriteLine(min);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement