// Finding Pythagorian Triples
#include <iostream>
#include <cmath>
using namespace std;

// macro function definition
#define hypotenus(x,y) sqrt((x)*(x) + (y)*(y))
#define N 50

int main ()
{
  int a, b, c;

  cout << "Pythagorean Triples less than N = 50" << endl;

  for (a=1; a<=N; a++)
  for (b=a; b<=N; b++)
  for (c=1; c<=N; c++)
      if( c == hypotenus(a,b) )
          cout << "("
               << a << ", " << b << ", " << c
               << ")" << endl;

  return 0;
}
