| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
提交了N遍,就是不知道那里RA,麻烦大家看看!!#include<iostream>
using namespace std;
#include<cstdio>
int main()
{
int n, i, high=11, low=0, right=0;
char s[8];
int k=1;
while(cin>>n)
{
if(n==0)
break;
getchar();
gets(s);
if(s[4]=='h')i=0;
else if(s[4]=='l')i=1;
else if(s[4]=='t')i=2;
if(i==0&&high>n)high=n;
else if(i==1&&low<n)low=n;
else if(i==2)right=n;
if(right!=0)
{
if(right<high&&right>low&&right>0&&right<11)
cout<<"Stan may be honest"<<endl;
else
cout<<"Stan is dishonest"<<endl;
right=low=0;high=11;
k=0;
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator