哪里错了,高手进来看一下吧,太谢谢了

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:54:29
#include "stdio.h"

void main()
{float L,B,H,a,b,h;
int M0,M1,M2,M3,M4,M5,M[5];
int i,j,t,max;
printf("input 6 numbers:\n");
scanf("%f%f%f%f%f%f",&L,&B,&H,&a,&b,&h);

char a[6][100]={"(int)(L/a)*(int)(B/b)*(int)(H/h)","(int)(L/a)*(int)(B/h)*(int)(H/b)",
"(int)(L/b)*(int)(B/a)*(int)(H/h)","(int)(L/b)*(int)(B/h)*(int)(H/a)",
"(int)(L/b)*(int)(B/h)*(int)(H/a)","(int)(L/h)*(int)(B/a)*(int)(H/b)"};

M[0]=M0=(int)(L/a)*(int)(B/b)*(int)(H/h);
M[1]=M1=(int)(L/a)*(int)(B/h)*(int)(H/b);
M[2]=M2=(int)(L/b)*(int)(B/a)*(int)(H/h);
M[3]=M3=(int)(L/b)*(int)(B/h)*(int)(H/a);
M[4]=M4=(int)(L/h)*(int)(B/a)*(int)(H/b);
M[5]=M5=(int)(L/h)*(int)(B/b)*(int)(H/a);
max=M[0];
for(i=1;i<6;i++)
{if(M[i]>max)
{max=M[i];}
printf("course of max%c=%d",a[i][100],max);
}
for(j=0;j&

请注意字符跟字符串的区别。
如果是字符就不用双引号,用单引号
字符用c%,字符串用s%
很明显楼主乱用的。
其最严重的问题在于数组不能如此初始化。
而且a在前面已经定义成浮点型,后面定义的字符数组请不要再用a作数组名。
如可以另外定义一个字符数组d,然后可以用初始化M那样的方法来初始化d。