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.
Project Euler #9: Special Pythagorean triplet
Project Euler #9: Special Pythagorean triplet
Sort by
recency
|
167 Discussions
|
Please Login in order to post a comment
Do they want the primitive triplet or the triplet multiplied by the factor n/(a+b+c)
Maybe it can still be optimized:
C# code :
using System;
public class Solution { public static void Main(string[] args) { int t = Convert.ToInt32(Console.ReadLine());
}
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<