BNU Online Judge-34776-What does the fox say?
题目链接
http://www.bnuoj.com/bnuoj/problem_show.php?pid=34776
题意: fox 的叫声
例如测试用例
输入
toot woof wa ow ow ow pa blub blub pa toot pa blub pa pa ow pow toot
dog goes woof
fish goes blub
elephant goes toot
seal goes ow
what does the fox say?
输出
wa pa pa pa pa pa pow
这样理解就是其他动物没有叫过的声音就是fox叫的例如把toot woof wa ow ow ow pa blub blub pa toot pa blub pa pa ow pow toot 中woof blub toot ow
去掉就是答案。
代码
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
map<string,int>M;
int main()
{
int t;
scanf("%d",&t);
char s1[11000];
char ss[150];
char sss[110][110];
map<char,int>::iterator it;
while(t--)
{
getchar();
gets(s1);
int k=0;
M.clear();
memset(sss,'\0',sizeof(sss));
while(scanf("%s",ss)&&strcmp(ss,"say?")!=0)
{
k++;
if(k%3==0)
{
M[ss]=1;
}
}
//it=M.end();
//printf("%d\n",M.size());
//it=M.find("the");
M.erase(M.end(),M.end());
int len=strlen(s1);
int ans=0;
for(int i=0; i<len; i++)
{
if(s1[i]==' ')
{
ans++;
continue;
}
char d[10];
d[0]=s1[i];
d[1]='\0';
strcat(sss[ans],d);
}
int flag=0;
for(int i=0; i<=ans; i++)
{
if(!M[sss[i]])
{
if(flag==0)
{
printf("%s",sss[i]);
flag++;
}
else
printf(" %s",sss[i]);
}
}
printf("\n");
}
return 0;
}
BNU Online Judge-34776-What does the fox say?的更多相关文章
- [DFNews] Fire-Eye与Fox IT联合推出Cryptolocker解锁网站
Cryptolocker是臭名昭著的勒索程序,使用AES加密后密钥回传,用户除了缴纳赎金之外基本无法解密数据. 近日,知名安全公司Fire-Eye与Fox IT联合推出了针对该勒索程序的解锁网站 ht ...
- 在线教学、视频会议 Webus Fox(1)文本、语音、视频聊天及电子白板基本用法
Webus Fox是基于网页的在线教学.视频会议软件,不用安装,直接使用.它提供文本.语音.视频聊天,文件共享.电子白板等功能. 1. 登录 访问 http://flash.webus.cn/#,用自 ...
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
- CF 371B Fox Dividing Cheese[数论]
B. Fox Dividing Cheese time limit per test 1 second memory limit per test 256 megabytes input standa ...
- 2076 Problem F Quick Brown Fox
题目描述 A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . . ...
- NOJ 1074 Hey Judge(DFS回溯)
Problem 1074: Hey Judge Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: ...
- 在线教学、视频会议 Webus Fox(2) 服务端开发手册
上次在<在线教学.视频会议软件 Webus Fox(1)文本.语音.视频聊天及电子白板基本用法>里介绍了软件的基本用法.本文主要介绍服务器端如何配置.开发. 1. 配置 1.1 IIS配置 ...
- 在线教学、视频会议 Webus Fox(3) 客户端开发手册
本文主要介绍webus fox 客户端的配置及接口说明. 1. 文件列表和配置 1.1 文件列表 1.2 common.xml 配置 根据服务器端的部署, 替换[ServerUrl] , [RtmpP ...
- 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)
转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...
随机推荐
- BodyContent揭秘及定制复杂的JSP标签
BodyContent揭秘及定制复杂的JSP标签 标签: jspintegerwrapperclass设计模式 2010-08-30 11:30 4555人阅读 评论(0) 收藏 举报 分类: HT ...
- linux nfs文件夹、文件共享
◆一.概念 NFS是网络文件系统(Network File System)的简称,是分布式计算机系统的一个组成部分,可实现在异构网络上共享和装配远程文件系统. NFS由SUN公司开发,目前已成为文件服 ...
- C#设置word段落首行缩进为0
PublicVar.m_WordApp.Selection.ParagraphFormat.CharacterUnitFirstLineIndent = ; PublicVar.m_WordApp.S ...
- AVR编程_如何通过软件复位AVR?(转)
源:http://blog.sina.com.cn/s/blog_493520900100bpos.html Question 如何通过软件复位AVR? Answer 如果你想通过软件复位AVR,你应 ...
- spring加载过程中jar包加载不了,解决方法
当我们在开发spring项目时,一般会将jar包放到webInf/lib下,这样是myeclipse自动将jar包加载到tomcat中webapps下,但是当我们新建一个lib文件夹的情况下,我们ad ...
- CodeForces 620C Pearls in a Row
水题,每当出现重复就分割开来,最后留下的尾巴给最后一段 #include<cstdio> #include<cstring> #include<cmath> #in ...
- python_eval的用法
1. eval用法: 将字符串str当成有效的表达式来求值并返回计算结果. 2. eval的功能: math当成一个计算器很好用. 将字符串转换为list,tuple,dict. 3. 举例 # -* ...
- jQuery中$.get、$.post、$.getJSON和$.ajax的用法
以下是本人原创,如若转载和使用请注明转载地址.本博客信息切勿用于商业,可以个人使用,若喜欢我的博客,请关注我,谢谢!博客地址 一.jQuery中调用ajax的4种方法:$.get.$.post.$ge ...
- ZOJ 3537 Cake
区间DP. 首先求凸包判断是否为凸多边形. 如果是凸多边形:假设现在要切割连续的一段点,最外面两个一定是要切一刀的,内部怎么切达到最优解就是求子区间最优解,因此可以区间DP. #include< ...
- MYSQL一次性能优化实战经历[转]
每次经历数据库性能调优,都是对性能优化的再次认识.对自己知识不足的有力验证,只有不断总结.学习才能少走弯路. 一.性能问题描述 应用端反应系统查询缓慢,长时间出不来结果.SQLServer数据库服务器 ...