KirillKorobka

Untitled

Dec 14th, 2019
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Alex
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Enter number1");
  14. double num1 = double.Parse(Console.ReadLine());
  15.  
  16. Console.WriteLine("Enter number2");
  17. double num2 = double.Parse(Console.ReadLine());
  18.  
  19. Console.WriteLine("Enter number3");
  20. double num3 = double.Parse(Console.ReadLine());
  21.  
  22. double average;
  23.  
  24. if (num1 < num2 && num2 < num3)
  25. {
  26. average = num2;
  27. }
  28. else if (num2 < num1 && num1 < num3)
  29. {
  30. average = num1;
  31. }
  32. else
  33. {
  34. average = num3;
  35. }
  36.  
  37. Console.WriteLine("You entered: " + num1 + ", " + num2 + " и " + num3 + ". Average of them " + average + ".");
  38. }
  39. }
  40. }
RAW Paste Data