View Code of Problem 90

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

int main(){
    int n,m;
    cin>>n>>m;
    for (int i = n; i <= m; ++i) {
        for (int j = i; j <= m; ++j) {
            int a=i*i+j*j;
            int b=sqrt(a);
            if (b<=m&&b*b==a){
                cout<<i<<"^2+"<<j<<"^2="<<b<<"^2"<<endl;
            }
        }
    }

    return 0;
}

Double click to view unformatted code.


Back to problem 90