| 1234567891011121314151617181920212223242526272829303132 |
- #include <stdio.h>
- #include <stdint.h>
- int
- main(int argc, const char **argv)
- {
- uint64_t res = 0;
- uint64_t a = 1, b = 1, c = 1;
- uint64_t upper_limit = 1000;
- for ( a = 1; a < upper_limit; ++a ) {
- for ( b = 1; b < upper_limit; ++b ) {
- for ( c = 1; c < upper_limit; ++c ) {
- if ( ((a*a) + (b*b)) != (c*c) ) {
- continue;
- }
- if ( (a+b+c) != 1000 ) {
- continue;
- }
- res = a*b*c;
- goto end;
- }
- }
- }
- end:
- printf("Result = %ld!\n", res);
- (void) argc; (void) argv;
- return 0;
- }
|