TC2.0 代码运行小问题
TC2.0中一个已知高度通过输入长和宽来计算长方体体积的代码
为什么ctrl+F9(运行)之后输入了长和宽之后页面消失 在第二次运行后才会输出结果呢?
#include<stdio.h>
#define Height 10
int calculate(int Long,int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("The height of the rectangle is: %d\n",Height);
printf("Please enter the length of the rectangle\n");
scanf("%d",&m_Long);
printf("Please enter the width of the rectangle\n");
scanf("%d",&m_Width);
result=calculate(m_Long,m_Width);
printf("The volumeof the rectangle is:");
printf("%d\n",result);
return 0;
}
int calculate(int Long,int Width)
{
int result=Long*Width*Height;
return result;
}