bogdanalov

Untitled

Sep 29th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace MaxMethod
  5. {
  6. class MaxMethod
  7. {
  8. static void Main()
  9. {
  10. int numberOne = int.Parse(Console.ReadLine());
  11. int numberTwo = int.Parse(Console.ReadLine());
  12. int numberThree = int.Parse(Console.ReadLine());
  13. int greaterNumber =GetMax(numberOne, numberTwo);
  14. int max =GetMaxFromSecond(numberThree, greaterNumber);
  15. Console.WriteLine(max);
  16.  
  17. }
  18.  
  19. private static int GetMaxFromSecond(int numberThree, int numberGetMax)
  20. {
  21. if (numberThree > numberGetMax)
  22. {
  23. return numberThree;
  24. }
  25. else
  26. return numberGetMax;
  27. }
  28.  
  29. static int GetMax(int a, int b)
  30. {
  31. if (a > b)
  32. {
  33. return a;
  34. }
  35. else
  36. return b;
  37.  
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment