//这题足足用了我4个多小时来检查错误(半个小时写代码)!实在太愚蠢了!头都爆了!哎!
//而且这一题并没有区分大小写的,一般没有考虑到的情况,都可以通过代码后面的样例发现,
//这题实在太坑爹了!被折磨了数小时,经历了无限次WA!虽然是水题一道!
#include <iostream>
#include <string>
#include <map>
using namespace std;map<string, int> m;
map<string, int>::iterator it; int main()
{int i, len, max = 0, time; string word, tmp; bool flag; while (cin >> word){len = word.length();tmp.clear(); flag = false; for (i = 0; i < len; i++){if (isalpha(word[i])){word[i] = tolower(word[i]);tmp.push_back(word[i]); flag = false; }else{time = ++m[tmp];flag = true; if (time > max)max = time;tmp.clear(); } }if (!flag){time = ++m[tmp];if (time > max)max = time; } } cout << max << " occurrences" << endl;for (it = m.begin(); it != m.end(); it++){if (it->second == max)cout << it->first << endl; } system("pause");
} /*
a,a.a/a'a;a\a-a(a)and.. and
and.and. andans.ans New new
*/ 

poj 1583 Choose Your Words Carefully相关推荐

  1. POJ 1583 Choose Your Words Carefully G++

    #include <iostream> #include <cstdio> #include <map> #include <string> #incl ...

  2. POJ前面的题目算法思路【转】

    1000 A+B Problem 送分题 49% 2005-5-7 1001 Exponentiation 高精度 85% 2005-5-7 1002 487-3279 n/a 90% 2005-5- ...

  3. POJ 超详细分类

    POJ 各题算法 1000    A+B Problem            送分题     49%    2005-5-7 1001    Exponentiation         高精度   ...

  4. HOJ题目分类//放这儿没事刷刷学算法!嘻嘻!

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  5. Spring中的p标签(转)good

    Spring的p标签是基于XML Schema的配置方式,目的是为了简化配置方式. 在XML文件头部添加xmlns:p="http://www.springframework.org/sch ...

  6. 怎么让前端项目运行起来_如何立即使您的前端项目看起来更好

    怎么让前端项目运行起来 We've all been there. You've been learning the basics of front end Web development, and ...

  7. 《高效的项目和团队》

    Productive Projects and Teams是一本好书. 许多其中许多关于管理和沟通的精辟言论让我大有相见很晚之感.其实不仅是软件的开发项目,任何项目,甚至任何行业的管理,都首先是对人的 ...

  8. 《Developing and maintaining clients’ trust through institutional mechanisms in online...》中英文对比文献翻译

    <Developing and maintaining clients' trust through institutional mechanisms in online service mar ...

  9. 架构师须知97件事精华版

    原文 摘要 描述 17.    Business Drives   by Dave Muirhead [业务决定技术] 为了建设一个系统,架构师必须把技术部门和业务部门团结在一起.但要明白二者的立场是 ...

最新文章

  1. python subprocess_python subprocess
  2. __block的初步用法
  3. 数据库连接池和Tomcat连接池的配置问题
  4. php data类型转换,【原】超简单类型转换(DataTable
  5. java转换文本文件到xlsx(自制缓冲区,无需先验文件行数)
  6. 几种限流器(RateLimiter)原理与实现
  7. SQL Server 2005中NTEXT与NVARCHAR(MAX)
  8. 虚拟机环境下ansible方式部署tidb3.0时系统检测不通过
  9. 蓝桥杯 算法提高 队列操作
  10. java怎么限制一个对象的内存_java对象的内存布局及创建过程
  11. 毕设题目:Matlab DTMF双音多频
  12. 【软考】软件设计师知识点整理(待更新)
  13. ectouch添加手机注册框
  14. C语言,从入门到放弃
  15. WebService入门(二)wsimport的使用
  16. python tab键自动补全怎么用_Python语言之使用tab键自动补全
  17. 发票管理小工具(三):PDFMiner vs pdfminer3k vs Pdfminer.six
  18. 未来行业发展趋势分析
  19. 建立AI智能系统智商评测体系,开展世界人工智能智商评测
  20. 百度竞价账户关键词分类

热门文章

  1. 如何解决hbase中数据热点问题
  2. 【python学习】列表、元组、字典、集合(详解)
  3. 7.Maven依赖的基本概念
  4. 警惕钓鱼网站,除了个人信息还能找到你的住址!
  5. 浅谈赢得值理论的运用-Oracle p6
  6. Blazor University (21)使用 RenderFragments 模板化组件 —— 传递占位符
  7. 详细安装指南-Ubuntu16.04,CUDA8.0,Caffe,OpenCV3.1,Theano,Tensorflow,纯属转载,等待自己修改
  8. 制作UEFI模式Ubuntu启动U盘
  9. 影响债市行情的主要因素_【金研·深度】影响当前利率债走势的主要因素是什么?(下)...
  10. Spy vs. Spy