Advertisement
Spocoman

07. Min Number

Nov 21st, 2021 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MinNumber
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string num = Console.ReadLine();
  10.             int minNum = int.MaxValue;
  11.  
  12.             while (num != "Stop")
  13.             {
  14.                 int n = int.Parse(num);
  15.                 if (n < minNum)
  16.                 {
  17.                     minNum = n;
  18.                 }
  19.  
  20.                 num = Console.ReadLine();
  21.             }
  22.             Console.WriteLine(minNum);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement