题目链接

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. Swift 开发中Alamofire的使用

    Swift 开发中Alamofire的使用 Alamofire需要解决的6个问题 1.Json解析 2.下载和上传 4.全局401错误 5.网络图片

  2. 可能是最简单的方式:利用Eclipse创建基于Maven的Web项目

    1. 新建一个maven项目 2.在弹出框中选择创建一个简单项目 3. 然后输入参数,需要注意的是,在packagin中,选择war,web项目应该选择war 4. 点击finish后,基本项目结构就 ...

  3. Properties 使用,注意编码

    private static void setConfig(){ try { // String path = System.getProperty("user.dir") + & ...

  4. Android USER 版本与ENG 版本的差异--MTK官方解释

     分类: Android(4)  Description]Android USER 版本与ENG 版本的差异 [Keyword]USER ENG user eng 用户版本 工程版本 差异 [Solu ...

  5. python之路: 基础篇

    )或>>> name = )    #按照占位符的顺序):]        #下标识从0开始的 wulaoer >>> print name[:]        # ...

  6. Jquery 源码学习

    https://www.youtube.com/watch?v=qeMFEz_ufZc http://stackoverflow.com/questions/7194784/analysing-the ...

  7. python redis list操作

    LPUSH list_name value [value ...] Prepend one or multiple values to a list 从左侧插入值,最早插入的值在最右边 LPUSHX ...

  8. Javascript隔离方法

    1.常用的隔离方法: (function() { })(); 2.query的隔离方法: 需要引入jquery: <script type="text/javascript" ...

  9. (简单) POJ 3264 Balanced Lineup,RMQ。

    Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same ...

  10. 贪心法基础题目 HDU

    贪心算法的基本步骤: 1.从问题的某个初始解出发.2.采用循环语句,当可以向求解目标前进一步时,就根据局部最优策略,得到一个部分解,缩小问题的范围或规模.3.将所有部分解综合起来,得到问题的最终解. ...