Skip to content

Instantly share code, notes, and snippets.

@kiloreux
Created November 8, 2014 20:33
Show Gist options
  • Save kiloreux/cea50beef491503d5568 to your computer and use it in GitHub Desktop.
Save kiloreux/cea50beef491503d5568 to your computer and use it in GitHub Desktop.
My solution to Project Euler problem
#include<iostream>
using namespace std;
int main(void)
{
const int sum=1000;
int a,b,c;
for(a=0;a<1000;a++)
{
for(b=0;b<1000;b++)
{
c=sum-a-b;
if(a*a+b*b==c*c&&a+b+c==1000)
{
cout<<a*b*c<<endl;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment