查论文重复率软件:如何得到一个文本文件的总的字符数。。。。。

来源:百度文库 编辑:高考问答 时间:2024/04/29 01:21:50
c++编程。。。。谢谢

#include<fstream>
#include<iostream>
using namespace std;

int main()
{
ifstream in_stream;
char filename[256];
char t;
int count=0;
do
{
cout<<"Please input the filename:";
cin>>filename;
in_stream.open(filename);
}while(in_stream.fail());
while(in_stream>>t) ++count;
cout<<"This file have "<<count<<" characters."<<endl;
cin>>count;

return 0;
}

用word打开,工具>>字数统计