1. 首页
  2. 数据库
  3. 其它
  4. 如何统计在一篇文章中某个单词出现了几次以及第一次出现的位置

如何统计在一篇文章中某个单词出现了几次以及第一次出现的位置

上传者: 2021-01-03 21:53:38上传 PDF文件 23.9KB 热度 12次
这篇文章提供的代码的作用就是对某个单词在文章中出现的次数进行统计。 实现代码: #include #include #include using namespace std; void main() { freopen(in.txt,r,stdin); freopen(out.txt,w,stdout); string word,paper; getline(cin,word); getline(cin,paper); short len1=word.size(); short len2=pape
下载地址
用户评论