kisame1313

Untitled

Jul 15th, 2017
81
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.         static int WriteNumbers ( int [] i )
  14.         {
  15.             int maxValue = int.MinValue;
  16.             foreach ( int j in i )
  17.             {
  18.                 if ( j>maxValue )
  19.                 {
  20.                     maxValue = j;
  21.                 }
  22.             }
  23.             return maxValue;
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment