一道简单的ACM程序题

来源:百度知道 编辑:UC知道 时间:2024/06/08 11:34:42
Description
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 &q

if(c[i]<c[j]&&strcmp(b[i],"too high")==0||
c[i]>c[j]&&strcmp(b[i],"too low")==0||c[j]<1||c[j]>10)
中c[i]<c[j]改成c[i]<=c[j];c[i]>c[j]改成c[i]>=c[j],应该不用我解释了吧。
你很有发展潜力,好好努力吧

http://youa.baidu.com/item/2dcf375866a396bc1412dc83
给1元钱,我帮你看!

要不然,让ivaniren帮你做吧;)

高兄不地道!