View Code of Problem 90

#include<bits/stdc++.h>
#include<string>
#include<math.h>
using namespace std;
 
int main(){
	int a,b;
	char c;
	while(cin>>a>>c>>b){
		for(int i=a;i<b;i++)
		for(int j=i;j<b;j++)
		for(int k=j;k<=b;k++){
		
			if(k*k==i*i+j*j)
			{
				cout<<i<<"^2+"<<j<<"^2="<<k<<"^2"<<endl; 
			}
		}
		
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 90