📄 ex10-3.cpp
字号:
# include <iostream>
# include <fstream>
using namespace std;
void main()
{
char ch;
ifstream tfile("a.txt",ios_base::binary);
if(tfile)
{
ofstream ofile("b.txt",ios_base::out);
tfile.get(ch);
while(!tfile.eof())
{ ofile<<char(toupper(ch));
tfile.get(ch);
}
ofile.close();
cout<<"成功输出到b.txt"<<endl;
}
else
cout<<"不能打开a.txt文件"<<endl;
tfile.close();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -