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 |
帮帮忙吧 WA伤了#include <stdio.h> #include <string.h> int main() { int n, min,max, honest; char res[10]; while( scanf("%d", &n) && n ) { honest = 1, min=1, max=10; // 初始化 while( scanf("%*s%s", &res) && strcmp(res, "on") ) { if( honest ) { if( strcmp(res, "high")==0 ) max = n-1; else min = n+1; if( max<min || min<1 ||max>10 ) honest = 0; } scanf("%d", &n); } if( !honest || (n<min) || n>(max)) printf("Stan is dishonest\n"); else printf("Stan may be honest\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