Skip to content

Instantly share code, notes, and snippets.

@rsayers
Created January 20, 2014 22:16
Show Gist options
  • Select an option

  • Save rsayers/8530376 to your computer and use it in GitHub Desktop.

Select an option

Save rsayers/8530376 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
int a,b,c;
for (a=0;a<10000;a++){
for(b=a+1;b<10000;b++){
for(c=b+1;c<10000;c++){
if (a*a+b*b==c*c){
if (a+b+c==1000){
printf("%d %d %d\n",a,b,c);
printf("DONE\n");
exit(0);
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment