📄 p11_11.cpp
字号:
/****************************************************
* 程序名:p11_11.cpp *
* 功能: 文本文件的输入 *
* By Antony *
* 02-08-2005 *
****************************************************/
# include <fstream>
# include <iostream>
using namespace std;
void main() {
char name[8],score[6];
ifstream txtfile; //建立输入文件流对象
txtfile.open("d:\\c++book\\record.txt");
if(!txtfile) {
cerr<<" record.txt open error!"<<endl;
exit(1);
}
while(!txtfile.eof()) {
txtfile>>name>>score;
cout<<name<<'\t'<<score<<endl;
}
txtfile.close();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -