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 ...
随机推荐
- 开启真机的View Server引入HierarchyViewer/By写monkeyrunner自动化测试脚本
其实相关文章网上也有不少了,不过在真机上开启View Server的中文文章好像只有一篇,前段时间按照这篇文章的内容,并结合英文源文去hack我的Nexus S(4.1.2)也走了一点弯路.现在总结一 ...
- vc里面怎样实现对话框之间传递变量的值
Dialog1的类名是CDialog1, 头文件是dialog1.h.里有成员变量CString str1, str2;Dialog2的类名是CDialog2, 头文件是dialog2.h.里有成员变 ...
- 线程中sleep方法和wait方法有什么区别?
如果你没有接触过java的多线程,那么多对于这两个方法可能有点陌生,看名字好像这两个方法是差不多的,但是实际上面差别好大. 首先我们看一下官方的API Sleep(sleep有两个方法,另一个方法传递 ...
- find文件后cp、rm
复制: find <src-path> -name 'some names' -exec cp {} <dest-path> \; find <src-path> ...
- json格式数据,将数据库中查询的结果转换为json, 然后调用接口的方式返回json(方式一)
调用接口,无非也就是打开链接 读取流 将结果以流的形式输出 将查询结果以json返回,无非就是将查询到的结果转换成jsonObject ================================ ...
- Linux-ssh的rsa认证登录配置
首先看一下实验环境: [root@localhost ~]# cat /proc/version #ip 192.168.254.130 Linux version 2.6.32-431.el6.x8 ...
- 如何使用 AngularJS 的 ngShow 和 ngHide
今天我们来看看怎样使用Angular的ngShow 和ngHide 指令来完成它们听起来应该完成的,显示和隐藏! 它们应该做的事 ngShow 和ngHide 允许我们显示或隐藏不同的元素.这有助于创 ...
- ios中的关键词@property @synthesize
@interface Person : NSObject{ int myNumber;} @property(nonatomic) int myNumber;//这个关键字是可以带套get 与s ...
- php:sprintf
十六进制 $hex = sprintf("%x",18); 输出:12(%x表示十六进制) $hex = sprintf("%4x",18); 输出:strin ...
- 作为Web开发人员,我为什么喜欢Google Chrome浏览器
来源: http://www.cnblogs.com/QLeelulu/archive/2011/08/28/2156402.html 在Google Chrome浏览器出来之前,我一直使用FireF ...