We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
where is the mistake in my code if any one find it please tell me
include
using namespace std;
int main(){
long long n,m,x=0;
cin>>n;
while(n--){
cin>>m;
long long a,b,c;
for(a=m/2;a>2;a--){
for(b=m/3;b>1;b--){
c=m-(a+b);
if(c>0){
if(a*a == b*b + c*c){
cout<
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #9: Special Pythagorean triplet
You are viewing a single comment's thread. Return to all comments →
where is the mistake in my code if any one find it please tell me
include
using namespace std;
int main(){ long long n,m,x=0; cin>>n; while(n--){ cin>>m; long long a,b,c; for(a=m/2;a>2;a--){ for(b=m/3;b>1;b--){ c=m-(a+b); if(c>0){ if(a*a == b*b + c*c){ cout<