UVa 12592 - Slogan Learning of Princess
来源:互联网 发布:服务器数据迁移流程图 编辑:程序博客网 时间:2024/06/15 20:19
題目:王子去找他的公主,趕上了處決犯人,這時人們都在喊口號,王子把口號告訴公主,
輸出leader喊出口號時,公主應該喊的口號。
分析:簡單題、字符串。數據量較小,直接枚舉匹配即可。
說明:╮(╯▽╰)╭。
#include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <cmath>using namespace std;char first[22][111];char second[22][111];char said[111];int main(){int N, Q;while (~scanf("%d",&N,&Q)) {getchar();for (int i = 0; i < N; ++ i) {gets(first[i]);gets(second[i]);}scanf("%d",&Q);getchar();for (int i = 0; i < Q; ++ i) {gets(said);for (int i = 0; i < N; ++ i) {if (!strcmp(said, first[i])) {puts(second[i]);}}}} return 0;}
0 0
- UVa 12592 - Slogan Learning of Princess
- Prince and Princess UVA
- 增加slogan
- uva 10635 Prince and Princess
- UVA 10635 Prince and Princess
- Uva-10635-Prince and Princess
- UVA 10635 Prince and Princess
- uva 10635 - Prince and Princess
- UVA 10635 Prince and Princess
- UVA 10635 Prince and Princess
- uva 10635 - Prince and Princess
- UVA - 10635 Prince and Princess
- uva 10635 - Prince and Princess
- UVA 10635 - Prince and Princess
- UVA 10635 Prince and Princess
- UVA-10635 Prince and Princess
- uva 10635 - Prince and Princess
- uva 10635 Prince and Princess
- 我的Opencv4Android添加V4L2支持的移植记录(1)
- 关于<context:property-placeholder>的一个有趣现象
- 五大常用算法之一:分治算法
- 正则表达式学习(一)
- Java compiler level does not match解决方法
- UVa 12592 - Slogan Learning of Princess
- Oracle ORA-01033: ORACLE initialization or shutdown in progress 错误解决办法
- Android,图形图像之使用Path类
- Redis学习笔记(7)-info命令详解
- Codeforces 378C
- adt或者eclipse打开文件所在位置的插件
- [Unity3D] MoveTowards、Lerp、Slerp
- P=NP?
- 通过ftp上传图片 工具类