c语言编程错误[Error] expected `;' before "printf"
#include<stdio.h>#defineHeight10intcalculate(intlong,intWidth);intmain(){intm_Long;in...
#include<stdio.h>
#define Height 10
int calculate(int long, int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("长方形的高度是: %d\n",Height);
printf("请输入高度\n");
scanf("%d",&m_Long);
printf("请输入宽度\n");
scanf("%d",&m_Width);
result=calculate(m_Long,m_Width)
printf("体积是:")
printf("%d\n",result)
return 0;
}
int calculate(int Long,int Width)
{
int result =Long*Width*Height;
return result;
}
书上抄了的不知道哪里错了 展开
#define Height 10
int calculate(int long, int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("长方形的高度是: %d\n",Height);
printf("请输入高度\n");
scanf("%d",&m_Long);
printf("请输入宽度\n");
scanf("%d",&m_Width);
result=calculate(m_Long,m_Width)
printf("体积是:")
printf("%d\n",result)
return 0;
}
int calculate(int Long,int Width)
{
int result =Long*Width*Height;
return result;
}
书上抄了的不知道哪里错了 展开
2个回答
展开全部
#include<stdio.h>
#define Height 10
int calculate(int long, int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("长方形的高度是: %d\n",Height);
printf("请输入高度\n");
scanf("%d",&m_Long);
printf("请输入宽度\n");
scanf("%d",&m_Width);
result=calculate(m_Long,m_Width)); //少了分号
printf("体积是:")); //少了分号
printf("%d\n",result); //少了分号
return 0;
}
int calculate(int Long,int Width)
{
int result =Long*Width*Height;
return result;
}
#define Height 10
int calculate(int long, int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("长方形的高度是: %d\n",Height);
printf("请输入高度\n");
scanf("%d",&m_Long);
printf("请输入宽度\n");
scanf("%d",&m_Width);
result=calculate(m_Long,m_Width)); //少了分号
printf("体积是:")); //少了分号
printf("%d\n",result); //少了分号
return 0;
}
int calculate(int Long,int Width)
{
int result =Long*Width*Height;
return result;
}
展开全部
1、
#include<stdio.h>
#define Height 10
int calculate(int long, int Width);
你的函数声明的时候long 用了小写,long是关键字
按你后面的应该是int calculate(int Long, int Width);
2、
你的result=calculate(m_Long,m_Width)
printf("体积是:")
printf("%d\n",result)
全都没分号
#include<stdio.h>
#define Height 10
int calculate(int long, int Width);
你的函数声明的时候long 用了小写,long是关键字
按你后面的应该是int calculate(int Long, int Width);
2、
你的result=calculate(m_Long,m_Width)
printf("体积是:")
printf("%d\n",result)
全都没分号
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询