Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

牛哥,救命!why is it wrong?

Posted by woaixiyuan at 2008-03-24 13:45:28 on Problem 2328
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator