| ||||||||||
| 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>
#include<cstring>
using namespace std;
int main()
{
int a;
char ans[10];
while(1)
{
bool flag = false;
int Max = 100;
int Min = 0;
cin>>a;
if(a == 0)
break;
getchar();
gets(ans);
while(1)
{
if(a>Max||a<Min)
flag = true;
if(strcmp(ans,"right on") == 0)
break;
if(strcmp(ans,"too high") == 0&&a<Max)
Max = a;
if(strcmp(ans,"too low") == 0&&a>Min)
Min = a;
cin>>a;
getchar();
gets(ans);
}
if(flag)
{
cout<<"Stan is dishonest"<<endl;
}
else
cout<<"Stan may be honest"<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator