博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 1251 统计难题
阅读量:4646 次
发布时间:2019-06-09

本文共 994 字,大约阅读时间需要 3 分钟。

汉语提,题意清楚。当初还卡了我一个上午。哎。

ac代码:

View Code
#include 
#include
#include
#include
#include
#include
#include
using namespace std;const int maxn=26;struct node{ int cnt; node *next[maxn]; node() { cnt=0; for(int i=0;i
next[num]==NULL) location->next[num]=new node(); location->next[num]->cnt++; location=location->next[num]; } } int Search(string str) { node *location=root; for(int i=0;i
next[num]==NULL) return 0; location=location->next[num]; } return location->cnt; }}t;int main(){ char ss[20]; string str; while(cin.getline(ss,20) ) { str = ss; if(str== "") break;// for(int i = 0 ;i < strlen(ss); i ++) str += ss[i];// cout << "str == " << str << endl; t.Insert(str);// getchar();// ch = getchar(); } while(cin.getline(ss,20)) {// cout << "fff " << str << endl; str=ss; cout<
<

欢迎批评指正。谢谢!

转载于:https://www.cnblogs.com/RainingDays/archive/2012/11/12/2766579.html

你可能感兴趣的文章
Perl Poetry .
查看>>
python基础0
查看>>
fs包报错, you can run: npm install --save fs
查看>>
Guice Provider绑定
查看>>
进程和线程区别
查看>>
UE4入门学习2:工程结构分析
查看>>
[Office]PPT 2013如何设置图片为半透明?
查看>>
个人技术博客
查看>>
Windows 2003 Server安全配置完整篇
查看>>
inform表单验证,正则表达式,用户名,身份证,密码,验证码
查看>>
CSS圆角
查看>>
安装 Apache Commons Logging API步骤
查看>>
返回顶部
查看>>
Log4cplus <1> 编译
查看>>
TaskTracker发送Heartbeat以及接受HeartbeatResponse
查看>>
Java集合类--温习笔记
查看>>
Struts2中的bean标签
查看>>
JVM 性能调优实战之:使用阿里开源工具 TProfiler 在海量业务代码中精确定位性能代码...
查看>>
mysql函数之六:mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
查看>>
json-lib 使用教程
查看>>