VelizarAvramov

02. Max Method

Nov 17th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02._Max_Method
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int first = int.Parse(Console.ReadLine());
  10.             int second = int.Parse(Console.ReadLine());
  11.             int third = int.Parse(Console.ReadLine());
  12.  
  13.             int result = GetMax(first, second);
  14.             int total = GetMax(result, third);
  15.             Console.WriteLine(total);
  16.         }
  17.  
  18.         private static int GetMax(int first, int second)
  19.         {
  20.             if (first >= second)
  21.             {
  22.                 return first;
  23.             }
  24.             else
  25.             {
  26.                 return second;
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment