| ||||||||||
| 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 | |||||||||
Re:改着改着对了..........In Reply To:改着改着对了.......... Posted by:huanghaoxiang at 2009-10-19 22:21:25 是的
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int a,big,low;
char b[20];
scanf("%d",&a);
big=11;low=0;
while(a!=0){
getchar();
gets(b);
if(strcmp(b,"too high")==0)
{if(a<big) big=a;}
if(strcmp(b,"too low")==0)
{if(a>low) low=a;}
if(strcmp(b,"right on")==0)
{if(big>low&&big-low>1&&a>low&&a<big) printf("Stan may be honest\n");
else printf("Stan is dishonest\n");
big=11;low=0;}
scanf("%d",&a);
}
return 0;
}
>
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator