Skip to content

Instantly share code, notes, and snippets.

@BigRedEye
Created January 10, 2024 13:15
Show Gist options
  • Save BigRedEye/16440a2de551d9ae9bf23514a6a6d06b to your computer and use it in GitHub Desktop.
Save BigRedEye/16440a2de551d9ae9bf23514a6a6d06b to your computer and use it in GitHub Desktop.
#include <cstdint>
#include <cstdio>
bool check() {
uint32_t a = 1;
uint32_t b = 1;
uint32_t c = 1;
while (true) {
while (true) {
while (true) {
if (a * a * a + b * b * b == c * c * c) {
// printf("%u^3 + %u^3 == %u^3\n", a, b, c);
return true;
}
a++;
if (a > 1000) {
a = 1;
}
}
b++;
if (b > 1000) {
b = 1;
}
}
c++;
if (c > 1000) {
c = 1;
}
}
return false;
}
int main() {
if (check()) {
printf("Found\n");
} else {
printf("Not found\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment