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> 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator