Advertisement
kisame1313

Untitled

Jul 15th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ForLesson15
  4. {
  5.     class Program
  6.     {
  7.         static void Main ()
  8.         {
  9.             int [] args = new int [] { 1, 2, 3, 4, 5, 6 };
  10.             Console.WriteLine (WriteNumbers(args));
  11.            
  12.         }
  13.  
  14.         static int WriteNumbers ( int [] i )
  15.         {
  16.             int minValue = i[0];
  17.             foreach ( int j in i )
  18.             {
  19.                 if ( j<minValue )
  20.                 {
  21.                     minValue = j;
  22.                 }
  23.             }
  24.             return minValue;
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement