Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5.  
  6. Console.Write("Ievadi trijstura pirmo malu: ");
  7. int a = int.Parse(Console.ReadLine());
  8.  
  9. Console.Write("Ievadi trijstura otru malu: ");
  10. int b = int.Parse(Console.ReadLine());
  11.  
  12. Console.Write("Ievadi trijstura treso malu: ");
  13. int c = int.Parse(Console.ReadLine());
  14. int max, min, d, e, srd = 0;
  15.  
  16. if (a+b<=c && a+c<=b && b+c<=a)
  17. {
  18. Console.WriteLine("Tāds trijsturis neeksiste!");
  19. }
  20.  
  21. else
  22. {
  23. Console.WriteLine("Tāds trijsturis eksiste!");
  24. if (a > b && a > c)
  25. {
  26. max = a;
  27. }
  28. else if (b > a && b > c)
  29. {
  30. max = b;
  31. }
  32. else if (c > a && c > b)
  33. {
  34. max = c;
  35. }
  36.  
  37. if (a < b && a < c)
  38. {
  39. min = a;
  40. }
  41. else if (b < a && b < c)
  42. {
  43. min = b;
  44. }
  45. else if (c < a && c < b)
  46. {
  47. min = c;
  48. }
  49.  
  50. srd = a + b + c - max - min;
  51. d = min * min + srd * srd;
  52. e = max * max;
  53. Console.WriteLine("Trijsturis ir taisnlenka!");
  54. }
  55.  
  56. Console.ReadKey();
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement