#include<stdio.h> /*包含头文件*/
#define height 10 /*定义常量*/
int calculate(int long, int width); /*函数声明*/
int main() /*主函数main*/
{
int m_long; /*定义整形变量,表示长度*/
int m_width;
int result; /*定义整形变量,表示长方体体积*/
printf("The height is:%d\n",height); /*显示提示*/
printf("the length is:\n");
scanf_s("%d",&m_long);
printf("the width is:\n");
scanf_s("%d",&m_width);
result = calculate(m_long, m_width);
printf("The volume is:");
printf("%d\n", result);
return 0;
}
int calculate(int long, int width)
{ /*24*/
int result=long*width*height; /*25*/
return result;
}
1>c:\gabriel\c language study\project1\project1\计算体积.c(24): error C2055: 应输入形参表,而不是类型表
1>c:\gabriel\c language study\project1\project1\计算体积.c(25): error C2059: 语法错误:“类型”