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 ...
随机推荐
- Django:之中间件、微信接口和单元测试
Django中间件 我们从浏览器发出一个请求 Request,得到一个响应后的内容 HttpResponse ,这个请求传递到 Django的过程如下: 也就是说,每一个请求都是先通过中间件中的 pr ...
- 【Machine Learning in Action --2】K-近邻算法改进约会网站的配对效果
摘自:<机器学习实战>,用python编写的(需要matplotlib和numpy库) 海伦一直使用在线约会网站寻找合适自己的约会对象.尽管约会网站会推荐不同的人选,但她没有从中找到喜欢的 ...
- vs找不到svn源代码管理插件之我见
使用svn要安装两个文件,一个客户端:TortoiseSVN-1.8.msi,一个插件:AnkhSvn-2.5.msi:两个都安装好之后,在vs的tool(工具)选项卡中,选择自定义,然后选择sour ...
- Mysql找回root密码
1.停止数据库服务 service mysql stop 2.修改my.cnf 添加skip-grant-tables 3.重启数据库 service mysql restart 4.修改root密码 ...
- hibernate ——helloWorld程序(XML配置)
1.项目结构 2.hibernate实现了Java类 和 数据库表的映射(Map) 先看一下Student的Java类和对应的数据库表 package com.pt.hibernate; public ...
- php-redis 下载地址
http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/
- apicloud教程2 (转载)
本帖最后由 中山赢友网络科技有限公司 于 2015-10-17 15:38 编辑 继<APICloud之小白图解教程系列(一):认识APICloud>之后的第二篇教程. 本篇教程有以下知识 ...
- OpenGL ES 详解纹理生成和纹理映射步骤以及函数
通常一个纹理映射的步骤是: 创建纹理对象.就是获得一个新的纹理句柄 ID. 指定纹理.就是将数据赋值给 ID 的纹理对象,在这一步,图像数据正式加载到了 ID 的纹理对象中. 设定过滤器.定义了ope ...
- pkgmgmt: Comparison between different Linux Systems..
found this page.. already done by precedents.. installation: aptitude install apt-get install yum in ...
- 视频 -> 帧 浅析
原创:转载请注明出处 关于帧率 首先以下几个概念必须弄清楚 1.一个帧就是一个画面 2.视频有无数个帧组成 3.表达时间的量 CMTime 的定义: typedef struct { CMTimeV ...