miroslavbstoyanov

Untitled

Mar 4th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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 _03.Problem
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double a = double.Parse(Console.ReadLine());
  14. double b = double.Parse(Console.ReadLine());
  15. double c = double.Parse(Console.ReadLine());
  16.  
  17. if (a < b + c && b < a + c && c < a + b)
  18. {
  19. if (a == b && b == c & c == a)
  20. {
  21. Console.WriteLine("Triangle with sides {0}, {1} and {2} is equilateral.", a, b, c);
  22.  
  23. }
  24. else if (a != b && b != c & c != a)
  25. {
  26. Console.WriteLine("Triangle with sides {0}, {1} and {2} is scalene.", a, b, c);
  27. }
  28. else
  29. {
  30. Console.WriteLine("Triangle with sides {0}, {1} and {2} is isosceles.", a, b, c);
  31. }
  32. }
  33. else
  34. {
  35. Console.WriteLine("There is no triangle with sides {0}, {1} and {2}.", a, b, c);
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment