| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 350 人关注过本帖
标题:程序哪出错了?忘高手指点~
只看楼主 加入收藏
jack333fly
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2010-7-15
结帖率:83.33%
收藏
已结贴  问题点数:10 回复次数:1 
程序哪出错了?忘高手指点~
#include <iostream>
void initialize_screen();
double ca(double fa);
void show_results(double c, double f);
int main()
{
    using namespace std;
    double c1, f1;
    initialize_screen();
    cout << "Please enter f1:" << endl;
    cin >> f1;
    c1 = ca(f1);
    show_results(c1, f1);
    return 0;
}
void initialize()
{
    using namespace std;
    cout << endl;
    return;
}
double ca(double fa)
{
    using namespace std;
    return((5.0/9.0)*(fa - 32));
}
void show_results(double c, double f)
{
    using namespace std;
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(1);
    cout << "f is :" << f << endl
         << "c is :" << c << endl;
    return;
}
2010-07-19 00:02
rainbow1
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:2
帖 子:277
专家分:839
注 册:2010-5-19
收藏
得分:10 
1、把主函数的using namespace std;放到#include <iostream>
的下一行。
2、子函数里面的using namespace std;就不要再用了
3、void initialize_screen();子函数的名称不一致。
2010-07-19 07:32
快速回复:程序哪出错了?忘高手指点~
数据加载中...
 
   



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

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