ZOJ 1926 Guessing Game
#include<cstdio>
char s1[],s2[]; int num[];
int jg[];
int bz; int main()
{
int n,i;
while(~scanf("%d",&n))
{
int tot=;
if(n==) break;
scanf("%s%s",s1,s2);
if(s1[]=='r')
{
printf("Stan may be honest\n");
continue;
}
else if(s1[]=='t')
{
if(s2[]=='h')//高了
{
num[tot]=n;
jg[tot]=;//1表示高了
tot++;
}
else if(s2[]=='l')//低了
{
num[tot]=n;
jg[tot]=;//0表示低了
tot++;
}
}
while()
{
scanf("%d",&n);
scanf("%s%s",s1,s2);
if(s1[]=='r')
{
bz=n;
break;
}
else if(s1[]=='t')
{
if(s2[]=='h')//高了
{
num[tot]=n;
jg[tot]=;//1表示高了
tot++;
}
else if(s2[]=='l')//低了
{
num[tot]=n;
jg[tot]=;//0表示低了
tot++;
}
}
}
for(i=;i<tot;i++)
{
if((num[i]>bz&&jg[i]==)||(num[i]<bz&&jg[i]==)) continue;
else break;
}
if(i==tot) printf("Stan may be honest\n");
else printf("Stan is dishonest\n");
} return ;
}
ZOJ 1926 Guessing Game的更多相关文章
- ZOJ题目分类
ZOJ题目分类初学者题: 1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 13 ...
- ZOJ People Counting
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ 3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...
- ZOJ 3686 A Simple Tree Problem
A Simple Tree Problem Time Limit: 3 Seconds Memory Limit: 65536 KB Given a rooted tree, each no ...
- 2632: [neerc2011]Gcd guessing game
2632: [neerc2011]Gcd guessing game Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 144 Solved: 84[S ...
- ZOJ Problem Set - 1394 Polar Explorer
这道题目还是简单的,但是自己WA了好几次,总结下: 1.对输入的总结,加上上次ZOJ Problem Set - 1334 Basically Speaking ac代码及总结这道题目的总结 题目要求 ...
- ZOJ Problem Set - 1392 The Hardest Problem Ever
放了一个长长的暑假,可能是这辈子最后一个这么长的暑假了吧,呵呵...今天来实验室了,先找了zoj上面简单的题目练练手直接贴代码了,不解释,就是一道简单的密文转换问题: #include <std ...
- ZOJ Problem Set - 1049 I Think I Need a Houseboat
这道题目说白了是一道平面几何的数学问题,重在理解题目的意思: 题目说,弗雷德想买地盖房养老,但是土地每年会被密西西比河淹掉一部分,而且经调查是以半圆形的方式淹没的,每年淹没50平方英里,以初始水岸线为 ...
- ZOJ Problem Set - 1006 Do the Untwist
今天在ZOJ上做了道很简单的题目是关于加密解密问题的,此题的关键点就在于求余的逆运算: 比如假设都是正整数 A=(B-C)%D 则 B - C = D*n + A 其中 A < D 移项 B = ...
- ZOJ Problem Set - 1001 A + B Problem
ZOJ ACM题集,编译环境VC6.0 #include <stdio.h> int main() { int a,b; while(scanf("%d%d",& ...
随机推荐
- 错误: 找不到或无法加载主类 tomcat-juli.jar
错误: 找不到或无法加载主类 tomcat-juli.jar 然后就可以用了.
- Python第一天——入门Python(4)字典的常用操作
# dic={[1,2,3]:'123'} #可变类型不能当做字典的key,value可以使用任意类型 # dic={(2,3,4):'123'} # print (dic[(2,3,4)]) #元组 ...
- java 报表到excel
现加个jar包 http://pan.baidu.com/s/1boe5kXh vfp8 然后代码 package makeReportToExcel; import java.io.File; ...
- ECMAScript6之数值类型的扩展
数值类型的扩展 Number.isNaN ES6将isNaN方法从window身上移植到了Number对象上,使用时和ES5中的isNaN方法一样,但是这是Number对象的方法 Number.isN ...
- vb.net 结束进程
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ...
- JAVA-反射学习
原文:http://www.cnblogs.com/rollenholt/archive/2011/09/02/2163758.html 个人总结: 1. 反射是什么:由字节码文件(.class)获取 ...
- 《Intel汇编第5版》 条件汇编伪指令
一.条件汇编伪指令和宏使用可以使汇编程序更加灵活 二.通过伪指令来检查函数的参数是否为空,如果为空则输出警告信息 INCLUDE Irvine32.inc includelib Irvine32.li ...
- Ubuntu 14.04 绑定固定 IP
参考百度经验首先用root用户登录,然后输入你的root密码,如果不用root登录可以在命令之前添加sudo:然后编辑interfaces 文件,该文件位于/etc/network/下面, 执行如下命 ...
- LeetCode 385. Mini Parse
Given a nested list of integers represented as a string, implement a parser to deserialize it. Each ...
- Nginx redirect
if ($host != 'www.xxxxx.com' ) { rewrite ^/(.*)$ http://www.xxxx.com/$1 permanent; }