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.
int main()
{
int i=0,j=0;
int a,b,c,q,n;
int tcount=0;
cin>>q;
for (i=0;i
cin >>n;
for (i=1;i
for(j=i;j
auto t=pow(i*i+j*j-1,0.5);
if (typeid(t).name()==typeid(int).name())
if (t>=j && i+j+t<=n)
tcount++;
}
}
}
}
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 #223: Almost right-angled triangles I
You are viewing a single comment's thread. Return to all comments →
//What is wrong in my code ????
include
include
include
include
include
include
include
using namespace std;
int main() { int i=0,j=0; int a,b,c,q,n; int tcount=0; cin>>q; for (i=0;i cin >>n; for (i=1;i for(j=i;j auto t=pow(i*i+j*j-1,0.5); if (typeid(t).name()==typeid(int).name()) if (t>=j && i+j+t<=n) tcount++;
} } } } cout<