1、逐行读入
1 ifstream infile; 2 ofstream outfile; 3 infile.open("in.txt"); 4 outfile.open("out.txt"); 5 assert(infile.is_open()); //报错 6 string s,p; 7 while(getline(infile,s)){ 8 getline(infile,p); 9 cout<<
本文共 295 字,大约阅读时间需要 1 分钟。
1、逐行读入
1 ifstream infile; 2 ofstream outfile; 3 infile.open("in.txt"); 4 outfile.open("out.txt"); 5 assert(infile.is_open()); //报错 6 string s,p; 7 while(getline(infile,s)){ 8 getline(infile,p); 9 cout<<
转载于:https://www.cnblogs.com/ISGuXing/p/9866828.html