Advertisement
braveheart1989

Max_Method

May 5th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _30.MaxMethod
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int firstNum = int.Parse(Console.ReadLine());
  14.             int secondNum = int.Parse(Console.ReadLine());
  15.             int thirdNum = int.Parse(Console.ReadLine());
  16.             Console.WriteLine(GetMaxNum(GetMaxNum(firstNum,secondNum),thirdNum));
  17.             //Console.WriteLine(Math.Max(Math.Max(firstNum,secondNum),thirdNum));
  18.         }
  19.         static int GetMaxNum(int num1, int num2)
  20.         {
  21.             int maxNum = int.MinValue;
  22.             if (num1 > num2)
  23.             {
  24.                 maxNum = num1;
  25.             }
  26.             else
  27.             {
  28.                 maxNum = num2;
  29.             }
  30.             return maxNum;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement