标题:初级问题,多多关照
只看楼主
science
Rank: 1
等 级:新手上路
帖 子:63
专家分:0
注 册:2006-11-22
 问题点数:0 回复次数:4 
初级问题,多多关照
我刚学c++,虽然学c有不少时间,我刚下载了一个c++的编译环境,是Dev-c++4.9.9.0
但是编了一个小程序,有点问题。程序如下:
#include<iostream.h>
main()
{ int a,b,c;
cout<<"enter number a: b: "
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
}

怎么运行后,出现提示:source file not compiled
不知道是怎么回事
搜索更多相关主题的帖子: 初级 
2006-12-27 14:50
pusawl
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-12-14
得分:0 
老老实实用VC++吧

2006-12-27 21:25
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
得分:0 

没用过那个编译器,不过建议换个编译器吧
VC++ 6.0是比较流行的编译器,这个不错。


Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2006-12-27 22:03
caiqiufu
Rank: 1
等 级:新手上路
帖 子:93
专家分:0
注 册:2006-12-14
得分:0 
#include<iostream.h>
void main()
{ int a,b,c;
cout<<"enter number a: b: ";
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
}
可以了
2006-12-27 23:19
smartwind
Rank: 1
等 级:新手上路
威 望:1
帖 子:277
专家分:0
注 册:2006-11-13
得分:0 
应该这样写:
#include<iostream>
using namespace std;
int main()
{ int a,b,c;
cout<<"enter number a: b: "
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
return 0;
}

还在用VC++6.0写C++程序的建议升级到2005

2006-12-28 08:33



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




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

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