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