标题:帮忙看看怎么改
取消只看楼主
Cyber_EJ
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-3-13
 问题点数:0 回复次数:1 
帮忙看看怎么改
编写一个程序,从键盘输入一个摄氏温度,输出对应的华氏温度,关系式是C=5÷9×(F-72)

#include<iostream.h>
int add(int F)
{cout<<"In add() received"<<F<<"\n";
return(5/9*(F-72));
}
void main()
{int a,C;
cout<<"Enter one number:";
cin>>a;
cout<<"nCalling add()\n";
C=add(a);
cout<<"C was "<<C;
}

我的公式是不是错了   算不出来···算出结果总是0
救命啊·
搜索更多相关主题的帖子: add cout int 键盘 
2005-03-15 13:43
Cyber_EJ
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-3-13
得分:0 
哇··原来是这样!公式没错,把5/9改为 5.0/9.0就算得出了··
谢谢!!!
2005-03-15 22:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-13351-1-1.html




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

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