数学趣题——马克思手稿中的数学题
1: #include "stdio.h"
2:
3: void Marx()
4: {
5: int x,y,z;
6: for(x=1;x<30;x++)
7: for(y=1;y<30;y++)
8: for(z=1;z<30;z++)
9: {
10: if(3*x+2*y+z==50 && x+y+z==30)
11: printf("%5d %5d %5d\n",x,y,z);
12: }
13: }
14:
15: int main()
16: {
17: printf(" The solutions of Marx's topic\n");
18: printf(" Men Women Children\n");
19: Marx();
20: return 0;
21: }