| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 697 人关注过本帖
标题:【请教】这几个语句什么意思
只看楼主 加入收藏
げ訾澐み
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-7-18
收藏
 问题点数:0 回复次数:5 
【请教】这几个语句什么意思

#include<iostream>
#include<fstream>
int main()
{
using namespace std;
char automobile[50];
int year;
double a_price;
double d_price;
ofstream outFile;
outFile.open("carinfo.txt");
cout<<"enter*********automobile:";
cin.getline(automobile,50);
cout<<"enter******year:";
cin>>year;
cout<<"enter****price:";
cin>>a_price;
d_price=0.913*a_price;

outFile<<fixed;
outFile.precision(2);
outFile.setf(ios_base::showpoint);//这里没有定义fixed啊 ,还有就是下面的两个语句什么作用,
outFile<<"make and model:"<<automobile<<endl;
outFile<<"year:"<<year<<endl;
outFile<<"was asking $:"<<a_price<<endl;
outFile<<"now asking$:"<<d_price<<endl;
return 0;
}//他也生成了文本怎么从make and model开始就只生成在所创建的carinfo.txt,而不在屏幕上显示啊

[此贴子已经被作者于2007-7-19 10:44:31编辑过]

搜索更多相关主题的帖子: 语句 
2007-07-19 10:34
げ訾澐み
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-7-18
收藏
得分:0 
回复:(げ訾澐み)【请教】这几个语句什么意思
是不是我的问题提的太幼稚了,怎么 没人回答啊 ,还是我问得不对的啊

2007-07-19 14:08
げ訾澐み
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-7-18
收藏
得分:0 

2007-07-19 16:28
げ訾澐み
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-7-18
收藏
得分:0 
怎么还是没人解答啊 !!每人说两句的吗

2007-07-20 11:03
一番宝瓶
Rank: 1
等 级:新手上路
帖 子:239
专家分:0
注 册:2007-7-14
收藏
得分:0 
outFile 是文本输出流吖,&gt;&gt;直接都输入文本里了

2.3.2.2.2.0
2007-07-20 12:21
snowprince
Rank: 2
来 自:武汉
等 级:论坛游民
帖 子:108
专家分:48
注 册:2009-5-1
收藏
得分:0 
你没有写用cout怎么在屏幕上输出啊
cout是在屏幕上输出的
outFile是写入文本的
2009-11-07 11:39
快速回复:【请教】这几个语句什么意思
数据加载中...
 
   



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

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