#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc,char * argv [])
{
string str;
int n=0;
ifstream fin(argv[1]);
while(fin)
{
getline(fin,str);
cout << str << endl;
n++;
}
cout << " hang shu :";
cout << n << endl;
}
c++源代码:输出文件内容显示行数
最新推荐文章于 2024-06-20 21:12:52 发布