Sha256: 9b167c78d3da5923aab434a4997959fdc8641eac837386844fa7b2d36c19ae4e
Contents?: true
Size: 795 Bytes
Versions: 14
Compression:
Stored size: 795 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
14 entries across 14 versions & 1 rubygems