为什么输入两次数字后再按回车就自动关闭没给结果
#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>#defineHeight10intcalculate(intLong,in...
#define _CRT_SECURE_NO_WARNINGS
#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;
} 展开
#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;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询