📄 ch01.1.5.1.c
字号:
// #include <iostream>
// #include <fstream>
#include <iostream.h>
#include <fstream.h>
#include <string>
/**
**
stanl@john:d.01 264 : xsh32 ch01.1.5.1.c
**
stanl@john:d.01 267 : cat input_file
Shyly, she asks, "I mean, Daddy, is there?"
**
stanl@john:d.01 265 : a.out
**
stanl@john:d.01 266 : cat out_file
Shyly, she asks, "I mean, Daddy, is there?"
**
**/
int main()
{
ofstream outfile( "out_file" );
ifstream infile( "input_file" );
if ( ! infile ) {
cerr << "error: unable to open input file!\n";
return -1;
}
if ( ! outfile ) {
cerr << "error: unable to open output file!\n";
return -2;
}
string word;
while ( infile >> word )
outfile << word << ' ';
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -