首页上一页 1 下一页尾页 1 条记录 1/1页
初学 照个书上练习 但是执行出错了 求解
发表在C语言图书答疑
2016-03-24
是否精华
是
否
版块置顶:
是
否
#include<stdio.h>
#define heinght 10
int calculate(int Long,int Width);
int main()
{
int m_long;
int m_width;
int result;
printf("gao: %d\n",heinght);
printf("chang\n");
scanf("%d",&m_long);
printf("gao\n");
scanf("%d",&m_width);
result=calculate(m_long,m_width);
printf("tiji: "};
printf("%d\n",result);
return 0;
}
int calculate(int long,int width)
{
int result=long*width*hringht;
return result;
}
4.c
E:\uzzf\4.c(19) : error C2143: syntax error : missing ')' before '}'
E:\uzzf\4.c(24) : error C2055: expected formal parameter list, not a type list
E:\uzzf\4.c(24) : warning C4028: formal parameter 1 different from declaration
E:\uzzf\4.c(25) : error C2059: syntax error : 'type'
执行 cl.exe 时出错.
#define heinght 10
int calculate(int Long,int Width);
int main()
{
int m_long;
int m_width;
int result;
printf("gao: %d\n",heinght);
printf("chang\n");
scanf("%d",&m_long);
printf("gao\n");
scanf("%d",&m_width);
result=calculate(m_long,m_width);
printf("tiji: "};
printf("%d\n",result);
return 0;
}
int calculate(int long,int width)
{
int result=long*width*hringht;
return result;
}
4.c
E:\uzzf\4.c(19) : error C2143: syntax error : missing ')' before '}'
E:\uzzf\4.c(24) : error C2055: expected formal parameter list, not a type list
E:\uzzf\4.c(24) : warning C4028: formal parameter 1 different from declaration
E:\uzzf\4.c(25) : error C2059: syntax error : 'type'
执行 cl.exe 时出错.