Sir my code is passing first 3 testcases, but failing in 4 & 5 testcase. Can you please tell what correction do i need to make
Below is the code
#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long int n;
//unsigned long long int a = 1;
unsigned long long int st = 1;
unsigned long long int b;
cin>>n;
//unsigned long long int comp = n;
unsigned long long int en = 1;
int flag = 0;
while(flag != 1)
{
if(st>=100011)
{
cout<<"-1"<<endl;
flag = 1;
break;
}
en = (stst) + (nn);
en = sqrt(en);
//cout<<en<<endl;
if((enen) - (stst) == (n*n))
{
cout<<st<<" "<<en<<endl;
flag = 1;
break;
}
st++;
/else
cout<<"-1"<<endl;/
}
}
Pythagoras Triplet doubt
Hey, can you share the ide link of your code here, as the code you have pasted here is giving many compilation errors.
https://ide.codingblocks.com/s/56883 Sir this is my code link. Please tell how should i pass with test case 4 & 5.
Hey, try not to post the same query multiple times. I have resolved your query here, you can refer this.