⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab11_2.cpp

📁 清华大学郑莉《C++语言程序设计》课件、C++教材源代码、实验参考程序全集
💻 CPP
字号:
//lab11_2.cpp
#include <fstream>
#include <strstream>
#include <cstdlib>
using namespace std;

int main(int argc, char* argv[])
{
	
	strstream file1;
	{
		ifstream in(argv[1],ios::binary);
        file1 << in.rdbuf();
	}
	ofstream out(argv[1],ios::binary); 
	
	const int bsz = 100;
	char buf[bsz];
	int line = 0;
	while(file1.getline(buf, bsz)) {
		out.setf(ios::right, ios::adjustfield);
		out.width(1);
		out << ++line << ". " << buf << endl;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -