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

Version Path
trackler-2.2.1.59 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.58 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.57 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.56 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.55 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.54 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.53 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.52 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.51 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.50 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.49 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.48 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.47 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.46 tracks/c/exercises/triangle/src/example.c