首页上一页 1 下一页尾页 4 条记录 1/1页
C语言从入门到精通书上一个例子运行不出来,大神快来看看是怎么回事
发表在C语言图书答疑
2016-04-20
是否精华
是
否
版块置顶:
是
否
#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;
retrun result;
}
用的是VC 2008
#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;
retrun result;
}
用的是VC 2008