我的程序那里出问题了
#include"stdio.h"main()
{ int x,y,z;
printf("Solve the problem\n");
for(x=0;x<=20;x++)
for(y=0;y<=33;y++)
{
z=100-x-y;
if("z%3==0&&x*5+y*3+z/3=100")
}
printf("x=%d.y=%d.z=%d",x,y,z);
}
新手上路,一个百鸡百钱问题我试了好多次输出结果都是错的,求大神指教
2013-06-02 13:33

2013-06-02 13:50
2013-06-02 14:33
2013-06-02 14:35
程序代码:#include <stdio.h>
int main()
{
int x,y,z;
for(x=0;x<=100/5;x++)
{
for(y=0;y<=100/3;y++)
{
for(z=0;z<=100;z++)
{
if(x+y+z==100&&15*x+9*y+z==300)
{
printf("M,M,M\n",x,y,z);
}
}
}
}
return 0;
}

2013-06-02 14:42
2013-06-04 13:17

2013-06-04 21:33
2013-06-05 17:49