| ||||||||||
| 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 | |||||||||
难道有垃圾数据吗?哪位大虾帮我看看?怎么就WA了呢?#include<iostream.h>
#include<stdio.h>
#include<string.h>
int main()
{
int a,b=10,c=1;
char s[10];
while(1)
{
cin>>a;
if(a==0)break;
gets(s);
if(strcmp(s,"too high")==0)
{
if(b>=a)b=a-1;
}
else if(strcmp(s,"too low")==0)
{
if(c<=a)c=a+1;
}
else if(strcmp(s,"right on")==0)
{
if(a>=c&&a<=b)cout<<"Stan may be honest"<<endl;
else cout<<"Stan is dishonest"<<endl;
b=10;
c=1;
}
}
return 1;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator