题目链接

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?的更多相关文章

  1. [DFNews] Fire-Eye与Fox IT联合推出Cryptolocker解锁网站

    Cryptolocker是臭名昭著的勒索程序,使用AES加密后密钥回传,用户除了缴纳赎金之外基本无法解密数据. 近日,知名安全公司Fire-Eye与Fox IT联合推出了针对该勒索程序的解锁网站 ht ...

  2. 在线教学、视频会议 Webus Fox(1)文本、语音、视频聊天及电子白板基本用法

    Webus Fox是基于网页的在线教学.视频会议软件,不用安装,直接使用.它提供文本.语音.视频聊天,文件共享.电子白板等功能. 1. 登录 访问 http://flash.webus.cn/#,用自 ...

  3. Gym 101102C---Bored Judge(区间最大值)

    题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...

  4. CF 371B Fox Dividing Cheese[数论]

    B. Fox Dividing Cheese time limit per test 1 second memory limit per test 256 megabytes input standa ...

  5. 2076 Problem F Quick Brown Fox

    题目描述 A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . . ...

  6. NOJ 1074 Hey Judge(DFS回溯)

    Problem 1074: Hey Judge Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format: ...

  7. 在线教学、视频会议 Webus Fox(2) 服务端开发手册

    上次在<在线教学.视频会议软件 Webus Fox(1)文本.语音.视频聊天及电子白板基本用法>里介绍了软件的基本用法.本文主要介绍服务器端如何配置.开发. 1. 配置 1.1 IIS配置 ...

  8. 在线教学、视频会议 Webus Fox(3) 客户端开发手册

    本文主要介绍webus fox 客户端的配置及接口说明. 1. 文件列表和配置 1.1 文件列表 1.2 common.xml 配置 根据服务器端的部署, 替换[ServerUrl] , [RtmpP ...

  9. 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)

    转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...

随机推荐

  1. Java对数函数及Java对数运算

    Java对数函数及Java对数运算 2010-05-17 10:32 中国IT实验室 佚名   关键字:Java   Java对数函数的计算方法非常有问题,然而在API中却有惊人的误差.但是假如运用了 ...

  2. HDU 4456(二维树状数组+坐标转换)

    题目链接:Problem - 4456 看别人叙述看的心烦,于是我自己画了一张图. 上图. 上代码 #include <iostream> #include <cstdio> ...

  3. Selenium IDE安装

    1. 网上下载firefox30版本 http://www.9ht.com/xz/78637.html#addressWrap Selenium IDE 2.9.0下载   http://www.pc ...

  4. smali插入log,打印变量

    一:Log打印变量: Log打印字符串: #liyanzhong debug const-string v1, "TAG" const-string v2, "xunbu ...

  5. 【BZOJ3524/2223】[Poi2014]Couriers 主席树

    [BZOJ3524][Poi2014]Couriers Description 给一个长度为n的序列a.1≤a[i]≤n.m组询问,每次询问一个区间[l,r],是否存在一个数在[l,r]中出现的次数大 ...

  6. SQL复习六(视图)

    视图是关系数据库系统提供给用户以多角度观察数据库中数据的一种重要方法.视图是从一个或者几个表中导出的虚拟表.视图一经定义就可以被查询和删除.也可以在视图上定义视图.用视图完成数据的更新(增,删,改)操 ...

  7. appium通过WiFi连接真机进行测试

    http://www.th7.cn/Program/Android/201507/514602.shtml appium通过WiFi连接真机进行测试   2015-07-24 19:43:07CSDN ...

  8. [iOS Animation]-CALayer 性能优化

    性能优化 代码应该运行的尽量快,而不是更快 - 理查德 在第一和第二部分,我们了解了Core Animation提供的关于绘制和动画的一些特性.Core Animation功能和性能都非常强大,但如果 ...

  9. Jsoup使用教程

    一.解析和遍历一个HTML文档1.解析Html及Url链接 String html = "<html><head><title>First parse&l ...

  10. iOS开发:创建真机调试证书 分类: ios相关 2015-04-10 10:22 149人阅读 评论(0) 收藏

    关于苹果iOS开发,笔者也是从小白过来的,经历过各种困难和坑,其中就有关于开发证书,生产证书,in_house证书,add_Hoc证书申请过程中的问题,以及上架发布问题.今天就着重说一下关于针对于苹果 ...