2 shunfurh shunfurh 于 2017.09.10 23:42 提问

Guessing Game

Stan and Ollie are playing a guessing game. Stan thinks of a number between 1 and 10 and Ollie guesses what the number might be. After each guess, Stan indicates whether Ollie's guess is too high, too low, or right on.

After playing several rounds, Ollie has become suspicious that Stan cheats; that is, that he changes the number between Ollie's guesses. To prepare his case against Stan, Ollie has recorded a transcript of several games. You are to determine whether or not each transcript proves that Stan is cheating.

Input

Standard input consists of several transcripts. Each transcript consists of a number of paired guesses and responses. A guess is a line containing single integer between 1 and 10, and a response is a line containing "too high", "too low", or "right on". Each game ends with "right on". A line containing 0 follows the last transcript.

Output

For each game, output a line "Stan is dishonest" if Stan's responses are inconsistent with the final guess and response. Otherwise, print "Stan may be honest".

Sample Input

10
too high
3
too low
4
too high
2
right on
5
too low
7
too high
6
right on
0

Sample Output

Stan is dishonest
Stan may be honest

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.27 22:11
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
lintcode Guess Number Game(Java)
1.题目 We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wrong, I’ll tell you whether the number is
POJ 3589 Number-guessing Game(简单题)
【题目简述】:两个四位数,如果后一个数中的某个数与前一个对应的数的位置和值都相等,则统计数目由几个这样的数,记为count1吧。如果后一个数中的某个数与前一个数的数值相等,但位置不同。此时这样的数的个数记为count2。 写成*A*B,即count1 A count2 B。 【分析】:题目的简述即分析。 //740K 0Ms #include #include using namespace
BZOJ2632 [neerc2011]Gcd guessing game
题目描述有些问题,只要你心里知道那个数就行了 如果我们猜一个数,他告诉我们gcd不是1,那么相当于把n和你猜的数都除以gcd,他告诉你gcd是1。所以每次都告诉你是1是最坏的情况,这样当n以内的所有素数都作为询问的数的因数出现过,并且他告诉你gcd是1,从而n以内所有素数都被否认是答案的因数之后,我们就能确定答案是1 问题变成了我们要给n以内的素数分组,使得每组的乘积小于等于n,问最小组数
Guessing Game
FJNU.1509PKU.2328DescriptionStan and Ollie are playing a guessing game. Stan thinks of a number between 1 and 10 and Ollie guesses what the number might be. After each guess, Stan indicates whether
关于LeetCode中Guess Number Higher or Lower一题的理解
题目如下: We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wrong, I'll tell you whether the number i
TOJ 1423. Guessing Game
最近ACM状态不好,脑袋锈了,
poj 2328 Guessing Game
这道题很水,我开始想的太复杂,W
Guessing Game (P2328)
估计再过几天就不会做ACM了,最近也没有什么状态,在无聊的时候还是来水完 我最后几道吧。 #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { freo
poj2328 Guessing Game
两个猜数,一个说数字(1-10之间),另一个给提示高了还是低了,等到提示数字猜中时,下结论说正确的人是否撒谎。 #include #include void main(){ int num,low=0,high=11; char s[10]; scanf("%d",&num); memset(s,'\0',sizeof(s)); while(0 !
zoj 1926 Guessing Game
...