Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int is_int(long double x);
- int main() {
- long double x;
- long int y, MAX=50000000;
- printf("\n\tSolutions: ");
- for (y = 1; y < MAX; y++ ) {
- x = sqrt(1141.0*y*y+1.0);
- if (is_int(x)) {
- printf("\t%ld", y);
- }
- }
- printf("\n\n");
- return 0;
- }
- int is_int (long double x) {
- if (floor(x) != x) {
- return 0;
- }
- else{
- return 1;
- }
- }
Add Comment
Please, Sign In to add comment