#include <stdio.h> #include <math.h> 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++ ){ double d = sqrt(pow(i,2)+pow(j,2)); int t = (int)d; if( d == t && d<=b){ printf("%d^2+%d^2=%d^2\n", i,j,t); } } } return 0; } |
Double click to view unformatted code.