Advertisement
Martin82

Untitled

Jan 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. namespace StringTest
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Console.WriteLine(LowestTemp("32 53 23 10 57"));
  8.  
  9.             Console.ReadLine();
  10.         }
  11.  
  12.         static int LowestTemp(string temps)
  13.         {
  14.             var tempsArray = temps.Split(' ');
  15.  
  16.             int[] tempsToIntArray = new int[tempsArray.Length];
  17.  
  18.             for (int i = 0; i < tempsArray.Length; i++)
  19.             {
  20.                 tempsToIntArray[i] = int.Parse(tempsArray[i]);
  21.             }
  22.  
  23.             int lowestTemp = tempsToIntArray.Min();
  24.  
  25.             return lowestTemp;
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement