#include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #include<iostream> #include<algorithm> using namespace std; int main() { int a,b; scanf("%d,%d",&a,&b); for(int i=a; i<=b; i++) { for(int j=i; j<=b; j++) { int temp=(int)sqrt(i*i+j*j); if(temp*temp==i*i+j*j && temp<=b &&temp>=a) { printf("%d^2+%d^2=%d^2\n",i,j,temp); } } } } |
Double click to view unformatted code.