Advertisement
Qrist

Find Min Value

Apr 16th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     public static void Main(string[] args)
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         int min = int.MaxValue;
  9.         for (int i = 1; i <= n; i++)
  10.         {
  11.             int n1 = int.Parse(Console.ReadLine());
  12.             if (n1 < min)
  13.                 min = n1;        
  14.         }
  15.         Console.WriteLine(min);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement