BNUOJ 6038 - Reaux! Sham! Beaux!(模拟)
这是一个水模拟,但是因为图片看不清,手打比较烧脑,我们错了好多次才过
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<queue>
#include<algorithm>
using namespace std;
///0 Pock 1 Dcissors 2 Paper
int Judge(char *a,char *b)
{
if(!strcmp(a,"cs"))
{
if(!strcmp(b,"Kamen")) return ;
if(!strcmp(b,"Nuzky")) return ;
if(!strcmp(b,"Papir")) return ;
}
if(!strcmp(a,"en"))
{
if(!strcmp(b,"Rock")) return ;
if(!strcmp(b,"Scissors")) return ;
if(!strcmp(b,"Paper")) return ;
}
if(!strcmp(a,"fr"))
{
if(!strcmp(b,"Pierre")) return ;
if(!strcmp(b,"Ciseaux")) return ;
if(!strcmp(b,"Feuille")) return ;
}
if(!strcmp(a,"de"))
{
if(!strcmp(b,"Stein")) return ;
if(!strcmp(b,"Schere")) return ;
if(!strcmp(b,"Papier")) return ;
}
if(!strcmp(a,"hu"))
{
if(!strcmp(b,"Ko") || !strcmp(b,"Koe")) return ;
if(!strcmp(b,"Ollo") || !strcmp(b,"Olloo")) return ;
if(!strcmp(b,"Papir")) return ;
}
if(!strcmp(a,"it"))
{
if(!strcmp(b,"Sasso") || !strcmp(b,"Roccia")) return ;
if(!strcmp(b,"Forbice")) return ;
if(!strcmp(b,"Carta") || !strcmp(b,"Rete")) return ;
}
if(!strcmp(a,"jp"))
{
if(!strcmp(b,"Guu")) return ;
if(!strcmp(b,"Choki")) return ;
if(!strcmp(b,"Paa")) return ;
}
if(!strcmp(a,"pl"))
{
if(!strcmp(b,"Kamien")) return ;
if(!strcmp(b,"Nozyce")) return ;
if(!strcmp(b,"Papier")) return ;
}
if(!strcmp(a,"es"))
{
if(!strcmp(b,"Piedra")) return ;
if(!strcmp(b,"Tijera")) return ;
if(!strcmp(b,"Papel")) return ;
}
}
int main()
{
char cou1[],cou2[],p1[],p2[];
bool flag = true;
int ca = ;
while(~scanf("%s%s%s%s",cou1,p1,cou2,p2))
{
char op1[],op2[];
int tot1 = ,tot2 = ;
while(~scanf("%s",op1))
{
if(op1[] == '-' || op1[] == '.')
{
printf("Game #%d:\n",++ca);
if(tot1 == )
printf("%s: %d point\n",p1,tot1);
else printf("%s: %d points\n",p1,tot1);
if(tot2 == )
printf("%s: %d point\n",p2,tot2);
else printf("%s: %d points\n",p2,tot2);
if(tot1 > tot2) printf("WINNER: %s\n",p1);
else if(tot1 < tot2) printf("WINNER: %s\n",p2);
else puts("TIED GAME");
puts("");
if(op1[] == '.')flag = false;
break;
}
scanf("%s",op2);
int re1 = Judge(cou1,op1);
int re2 = Judge(cou2,op2);
/// cout<<"re1 = "<<re1<<endl;
/// cout<<"re2 = "<<re2<<endl;
if(re1 == re2) continue;
if(re1 == && re2 == ) tot1++;
else if(re1 == && re2 == ) tot1++;
else if(re1 == && re2 == ) tot1++;
else tot2++;
}
if(!flag) break;
}
return ;
}
BNUOJ 6038 - Reaux! Sham! Beaux!(模拟)的更多相关文章
- bnuoj 29373 Key Logger(模拟双向队列)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=29373 [题意]:模拟光标输入 [题解]:用双向列表模拟实现,这里用其他模拟会超时,注意内存的释放 ...
- bnuoj 20838 Item-Based Recommendation (模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=20838 [题意]: 有点长,略. [code]: #include <iostream> ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- bnuoj 4207 台风(模拟题)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=4207 [题意]:中文题,略 [题解]:模拟 [code]: #include <iostrea ...
- bnuoj 20832 Calculating Yuan Fen(暴力模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=20832 [题意]: 给你一串字符串,求一个ST(0<ST<=10000),对字符串中字符 ...
- bnuoj 33648 Neurotic Network(树形模拟题)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=33648 [题解]:结果先对MOD*2取模,才能得到结果是否是正确的奇偶问题,得到最后结果之后再对MO ...
- bnuoj 1057 函数(模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=1057 [题意]:给定x的值,带入f(x)求函数值 [题解]:注意第一个数的符号可能是'+',这里把我 ...
- bnuoj 27987 Record of the Attack at the Orbit (模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=27987 [题意]:给定坐标输出图形 [题解]:处理坐标上的小技巧 [code]: #include ...
- bnuoj 31796 键盘上的蚂蚁(搜索模拟)
http://www.bnuoj.com/bnuoj/contest_show.php?cid=2876#problem/31796 [题意]: 如题,注意大小写情况 [code]: #include ...
随机推荐
- IDEA类文件不编译问题
用IDEA的人遇到过类文件上有个小叉吗? 1.在 .gitignore 里面把这个文件去掉 2.setting->builder->compiler->子目录 去掉不编译的文件
- dfs.replication 参数 动态修改
首先 dfs.replication这个参数是个client参数,即node level参数.需要在每台datanode上设置.其实默认为3个副本已经够用了,设置太多也没什么用. 一个文件,上传到hd ...
- 哈佛大学构建动态网站--第七讲ajax
Ajax ajax举例: DOM的结构 通过js来修改html页面. Ajax的含义: return false的用途 跨浏览器的ajax 为什么不直接从yahoo获得数据呢? XMLHttpRequ ...
- PHP问答题大全
答案在题目后面,文字与背景同色,连续单机三次鼠标一行出答案哦: 1.PHP有几种原始数据类型,分别是什么?答:八种,分别是:int,float,string,bool,array,object,res ...
- drupal7 分页
$output = ""; $query = db_select('feedback','f')->extend('PagerDefault');//->extend( ...
- 转:用ANT执行SQL
http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=21340438&id=5160076 http://kayo.itey ...
- Spring Boot 系列教程14-动态修改定时任务cron参数
动态修改定时任务cron参数 不需要重启应用就可以动态的改变Cron表达式的值 不能使用@Scheduled(cron = "${jobs.cron}")实现 DynamicSch ...
- dede修改templets模板文件夹后,出现“无法在这个位置找到: ”错误的解决办法
修改templets模板文件夹的方法: 首先找到系统配置文件common.inc.php,此文件存放在Include目录下,打开common.inc.php来修改默认模板目录templets, 查找: ...
- UVA 10759 Dice Throwing
题意为抛n个骰子凑成的点数和大于或等于x的概率,刚开始用暴力枚举,虽然AC了,但时间为2.227s,然后百度了下别人的做法,交了一遍,靠,0.000s,然后看了下思路,原来是dp,在暴力的基础上记忆化 ...
- iOS UIScrollView偏移量属性
contentSize: The size of the content view. 其实就是scrollview可以滚动的区域,比如frame = (0 ,0 ,320 ,480) contentS ...