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

做的挺复杂不过呵呵过了 附代码

Posted by zjp at 2009-03-16 14:58:42 on Problem 2328
#include<stdio.h>
#include<string.h>
int main()
{char str1[]={"too high"};
char str2[]={"too low"};
char str3[]={"right on"};
int k=0,q=0,a,b[100],n,i,m,j[100],h,x,y,g;
char s[1000];
scanf("%d",&a);
while (a!=0)
{ gets(s);
if (strcmp (s,str1)==0)
{
b[k]=a;
k++;
}
m=k;
if (strcmp(s,str2)==0)
{
j[q]=a;
q++;
}
h=q;
if (strcmp(s,str3)==0)
n=a;
scanf("%d",&a);
}
printf("%d",n);
for (i=0;i<m;i++)
if (n>b[i])
break;
x=i;
for (i=0;i<h;i++)
if (n<j[i])
break;
y=i;
printf("%d %d\n",x,y);
printf("%d %d\n",m,h);
if (x!=m||y!=h)
printf("Stan is dishonest\n");
else 
printf("Stan may be honest\n");
}


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