Skip to content

Instantly share code, notes, and snippets.

@prrraveen
Created September 20, 2020 07:25
Show Gist options
  • Save prrraveen/257c18d37ed32be01eb4c397a2d05244 to your computer and use it in GitHub Desktop.
Save prrraveen/257c18d37ed32be01eb4c397a2d05244 to your computer and use it in GitHub Desktop.
for (int a = 1; a < 999; a++) {
for (int b = 1; b + a < 1000; b++) {
for (int c = 1; c+b+a < 1001; c++) {
if (a * a + b * b == c * c) {
p[a + b + c]++;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment