View Code of Problem 90

#include<stdio.h>
#include<math.h>

int main(){
	int i,j,k,a,b,c,t;
	scanf("%d%d",&a,&b);
	if(a>b)
	{
		t=a; a=b; b=t;
	}
	for (i=a;i*i<=b*b/2;i++)
		for(j=i;j<=b;j++)
		{
			c=i*i+j*j;
			k=sqrt(c);
			  if(k*k==c && k>=a && k<=b )
				  printf("%d^2+%d^2=%d^2\n",i,j,k);
		}			  
	return 0;
}

Double click to view unformatted code.


Back to problem 90