| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 410 人关注过本帖
标题:TC2.0 代码运行小问题
只看楼主 加入收藏
黑色洋葱
Rank: 2
等 级:论坛游民
帖 子:13
专家分:11
注 册:2014-2-14
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
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;
}

搜索更多相关主题的帖子: include result 长方体 
2014-02-21 15:57
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:20 
看错   不好意思

[ 本帖最后由 wp231957 于 2014-2-21 16:10 编辑 ]

DO IT YOURSELF !
2014-02-21 16:09
黑色洋葱
Rank: 2
等 级:论坛游民
帖 子:13
专家分:11
注 册:2014-2-14
收藏
得分:0 
在最后加system(“pause”);
我明白了
2014-02-22 13:18
快速回复:TC2.0 代码运行小问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018488 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved