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

Version Path
trackler-2.2.1.180 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.179 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.178 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.177 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.176 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.175 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.174 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.173 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.172 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.171 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.170 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.169 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.167 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.166 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.165 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.164 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.163 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.162 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.161 tracks/c/exercises/triangle/src/example.c
trackler-2.2.1.160 tracks/c/exercises/triangle/src/example.c