| ||||||||||
| 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 | |||||||||
牛哥,救命!why is it wrong?#include<stdio.h>
#include<string.h>
int main()
{
int num;
int low=0,high=11;
char message[20],str1[]={"too high"};
char str2[]={"too low"},str3[]={"right on"};
while(scanf("%d",&num)&&num!=0)
{
scanf("%s",message);
if(strcmp(message,str1)==0)
{ high=num; }
else if(strcmp(message,str2)==0)
{ low=num; }
else if(strcmp(message,str3)==0)
{
if(num>low&&num<high)
printf("Stan may be honest\n");
else
printf("Stan is dishonest\n");
low=0;high=11;
}
}
return(0);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator