Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

challenge

Name: Anonymous 2013-10-21 23:51

Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.

Name: Anonymous 2013-10-22 0:13

Why is it that all "challenges" are thinly-veiled attempts to get other people to do other peoples' homework?

#define LARGE1(x, y, z) ((x) > (y) ? (y) > (z) ? (x) : (x) > (z) ? (x) : (z) : (y) > (z) ? (y) : (z))
#define LARGE2(a, x, y, z) ((a) == (x) ? (y) > (z) ? (y) : (z) : (a) == (y) ? (x) > (z) ? (x) : (z) : (x) > (y) ? (x) : (y))
#define SUMSQ(x, y) ((x * x) + (y * y))

double someKidsHomework(double x, double y, double z)
{
    int lg = LARGE1(x, y, z);
    return SUMSQ(lg, LARGE2(lg, x, y, z));
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List