hdu 1251 统计难题 (map水过)
2015-12-31 17:37
363 查看
# include <stdio.h> # include <algorithm> # include <string> # include <map> # include <iostream> using namespace std; int main() { char a; string x; map<string,int>q; while(true) { scanf("%c",&a); if(a=='\n') { scanf("%c",&a); x="";//一个结束x初始化 } if(a=='\n')//连续两个\n结束了母串的输入 break; x+=a; q[x]+=1; } while(cin>>x) printf("%d\n",q[x]); return 0; }
相关文章推荐
- 借Kinect 扫描 软件 reconstructMe skanect ksan3d
- Java中List集合的遍历
- 为什么在ASP.NET中IIS发布后就不能观看视频了
- IntentService解析
- qstring.h赏析
- ios2倍3倍图
- git 版本历史
- 【Java学习笔记】——验证码
- java中Date与String的相互转化
- java设计模式----备忘录模式
- HttpClient4.4.1模拟登录知乎
- iOS经典讲解之socket编程”粘包“问题
- web时代变迁及html5与4的区别
- sikuli常用方法学习
- TCP连接检测机制
- Cocos2d中动作详解
- matlab自带knnclssify小实验
- Android上实现仿IOS弹性ScrollView
- IOS开发--基于Swift集成高德地图
- Unity3D与Android,iOS交互