View Code of Problem 90

#include <iostream>
#include <math.h>
using namespace std;

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

Double click to view unformatted code.


Back to problem 90