Skip to content

Instantly share code, notes, and snippets.

@ygabo
Created May 31, 2013 01:24
Show Gist options
  • Save ygabo/5682438 to your computer and use it in GitHub Desktop.
Save ygabo/5682438 to your computer and use it in GitHub Desktop.
void prob8(){
for( int c = 1; c <= 1000; c++ ){
for( int b = 1; b < c; b++){
for( int a = 1; a < b; a++){
if ( (a + b + c == 1000 ) &&
(pow(a,2) + pow(b,2) == pow(c,2)))
std::cout << a << " " << b << " " << c << " " << a*b*c << std::endl;
}
}
}
std::cin.get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment