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 |
哪位帮我看下哪里有错#include <stdio.h> #include <string.h> main() { int big[11]={11},small[11]={0},i,j,n,re,flag,k=0,m=0; char b[100]; i=j=0; while(scanf("%d",&n)!=EOF) { if(n==0) break; gets(b); if(strcmp(b,"too high")==0) { big[i]=n; i++; k=i; continue; } if(strcmp(b,"too low")==0) { small[j]=n; j++; m=j; continue; } if(strcmp(b,"right on")==0) { flag=1; re=n; for(i=0;i<k;i++) { if(big[i]<=re) { printf("Stan is dishonest\n"); flag=0; break; } } for(j=0;(j<m)&&(flag==1);j++) { if(small[j]>=re) { printf("Stan is dishonest\n"); flag=0; break; } } if(flag) printf("Stan may be honest\n"); big[0]=11; small[0]=0; i=j=0; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator