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 n; char a[10]; void kan(int n,char a[],int b[]) { if(strcmp("too high",a)==0) for(int i=n;11-i;i++) b[i]=1; if(strcmp("too low",a)==0) for(int i=n;i;i--) b[i]=1; } int main() { while(scanf("%d",&n),n) { int b[11]={0}; while(gets(a),strcmp("right on",a)) { kan(n,a,b); scanf("%d",&n); } if(b[n]==0) printf("Stan may be honest\n"); else printf("Stan is dishonest\n"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator