再看一边C++primer 5.1.4
来源:互联网 发布:军事软件 编辑:程序博客网 时间:2024/05/24 15:41
/*************************************************************************> File Name: test.cpp> Author:keson > Mail:keson@bupt.edu.cn > Created Time: 2014年12月10日 星期三 20时47分34秒 ************************************************************************/#include<iostream>#include<vector>#include<fstream>using namespace std;int main(){ string word; string currword; int currcnt=0; string result; int resultcnt; cin>>currword; result=currword; resultcnt=currcnt=1; while(cin>>word) { if(word==currword) { ++currcnt; if(currcnt>resultcnt) { result=currword; resultcnt=currcnt; } } else { currword=word; currcnt=1; } } cout<<endl; cout<<result<<" exist: "<<resultcnt<<"times"<<endl;}
0 0
- 再看一边C++primer 5.1.4
- 再看cpp primer(1)
- 再看c语言
- 再看Effective C++(1)
- 再看C语言输入
- 再看C语言
- 再看c语言-算法
- c++primer 4 笔记
- 《C++Primer》读书笔记(4)
- C Primer Plus2-4
- C Primer Plus3-4
- C Primer Plus4-4
- C Primer Plus5-4
- C Primer Plus6-4
- C Primer Plus7-4
- C Primer Plus8-4
- C Primer Plus9-4
- C Primer Plus10-4
- cygwin的bash错误:$'\r': command not found
- QString笔记
- Spring MVC 中的基于注解的 Controller
- 使用TileMap制作游戏地图,在cocos2d-x中使用(一)
- SpringMVC学习笔记--SimpleFormController
- 再看一边C++primer 5.1.4
- HDU 1280 前m大的数 (排序)
- hdu 2037
- 使用TileMap制作游戏,在cocos2d-x中使用(二)
- java持久化API
- 想着每年都要常回家看看
- POJ 2234-Matches Game(博弈)
- java 项目遇到的各种错误
- oracle查询表字段个数