fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace App
  7. {
  8. class Program
  9. {
  10. public static bool IsRightTriangle(double a, double b, double c)
  11. {
  12. return Math.Abs(c - Math.Sqrt(a * a + b * b)) < double.Epsilon;
  13. }
  14.  
  15. public static void Main(string[] args)
  16. {
  17. Console.WriteLine(IsRightTriangle(4, 3, 5));
  18. Console.WriteLine(IsRightTriangle(2, 3, 1));
  19. }
  20. }
  21. }
Success #stdin #stdout 0.01s 29656KB
stdin
Standard input is empty
stdout
True
False