📄 pku2328.cpp
字号:
#include "stdio.h"
int main()
{
int tn,high=10,low=1;
char s[5];
while(scanf("%d%*s%s",&tn,s)!=-1&&tn!=0)
{
high=10,low=1;
if(s[0]=='h')
{
high=(high>=tn)?tn-1:high;
}
else if(s[0]=='l')
{
low=(low<=tn)?tn+1:low;
}
while(s[0]!='o'&&scanf("%d%*s%s",&tn,s)!=-1&&s[0]!='o')
{
if(s[0]=='h')
{
high=(high>=tn)?tn-1:high;
}
else if(s[0]=='l')
{
low=(low<=tn)?tn+1:low;
}
}
if(high>=tn&&low<=tn)
{
printf("Stan may be honest\n");
}
else
{
printf("Stan is dishonest\n");
}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -