瑞星卡卡安全论坛技术交流区系统软件 编写一个C++程序,显示姓名和地址

1   1  /  1  页   跳转

编写一个C++程序,显示姓名和地址

编写一个C++程序,显示姓名和地址

#include<iostream>
using namespace std;
int main()
{
    double Name;
    double Address;
    cout<<"Enter your Name:";
    cin>>Name;
    cout<<endl;
    cout<<"Enter your Address:";
    cin>>Address;
    cout<<endl;
    return 0;
}
出错就是。。。我输入不了地址名啊。。为什么呢?

附件附件:

下载次数:755
文件类型:image/pjpeg
文件大小:
上传时间:2007-1-27 18:10:58
描述:



最后编辑2007-02-05 00:45:02
分享到:
gototop
 

问题解决了。。。
#include<iostream>
#include<string>
using namespace std;
int main()
{
string Name;
string Address;
cout<<"Enter your Name:";
cin>>Name;
cout<<endl;
cout<<"Enter your Address:";
cin>>Address;
cout<<endl;
return 0;
}
gototop
 

你定义的类型是double,输入一个string,怎么可能……
gototop
 

为什么不直接写#include<Iostream.h>呢??
gototop
 

感觉用char[]比较好
gototop
 

我喜欢,虽看不懂!
是不是常量 定义的越清楚!程序就越短啊??
gototop
 

我用Borland C++3.1编译器 编译1楼哥哥的程序提示Address 无效代码,请问是怎么回事?
gototop
 

是不是编译器不支持,谁有好用的给我发个啊,
gototop
 
1   1  /  1  页   跳转
页面顶部
Powered by Discuz!NT