Sha256: f9f6756fa2b1601637a21f739ec7e92f5989c50f3e2a547a21dfd02c275c5074
Contents?: true
Size: 768 Bytes
Versions: 119
Compression:
Stored size: 768 Bytes
Contents
#include "triangle.h" bool triangle_equality(triangle_t input) { return (input.a < (input.b + input.c) && input.b < (input.a + input.c) && input.c < (input.a + input.b) ); } bool is_equilateral(triangle_t input) { return (triangle_equality(input) && (input.a == input.b) && (input.b == input.c) ); } bool is_isosceles(triangle_t input) { return (triangle_equality(input) && ((input.a == input.b) || (input.b == input.c) || (input.a == input.c)) ); } bool is_scalene(triangle_t input) { return (!(is_equilateral(input)) && !(is_isosceles(input)) && triangle_equality(input) ); }
Version data entries
119 entries across 119 versions & 1 rubygems