View Code of Problem 90

#include<stdio.h>
int main()
{
	int a[1000],b[1000],c[1000];
	int d,e;
	scanf("%d,%d",&d,&e);
	int i,j,k,t,m;
	if(d>e)
	{
		t = d;
		d = e;
		e = t;
	}
	int temp = d;
	for(m=0;m<(e-d+1);m++)
	{
		a[m] = temp;
		b[m] = temp;
		c[m] = temp;
		temp++;
		//printf("%d %d %d\n",a[m],b[m],c[m]);
	}
	for(i=0;i<(e-d+1);++i)
	{
		for(j=i+1;j<(e-d+1);j++)
		{
			for(k=j+1;k<(e-d+1);k++)
			{
				if (a[i]*a[i] + b[j]*b[j] == c[k]*c[k] )
				{
					
					printf("%d^2+%d^2=%d^2\n",a[i],b[j],c[k]);
				}
			}
		}
	 } 
	 return 0;
}

Double click to view unformatted code.


Back to problem 90