Created
October 20, 2016 16:53
-
-
Save ryuichimatsumoto-single/3534b781c6ac6cac4f6247417ed8bba8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int x; | |
int y; | |
int z; | |
int p; | |
int start = 1; | |
int end = 10; | |
int count = 0; | |
for(x=start;x<end;x++) | |
{ | |
for(y=x;y<end;y++) | |
{ | |
for(z=y;z<end;z++) | |
{ | |
for(p=start;p<end;p++) | |
{ | |
//ここで(左辺)=(右辺)を計算する | |
if(x*y+y*z+z*x == p*x*y*z) | |
{ | |
count++; | |
printf("(p,x,y,z)=(%d,%d,%d,%d)\n",p,x,y,z); | |
} | |
} | |
} | |
} | |
} | |
printf("条件を満たす(p,x,y,z)の組:%d組\n",count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment