| ||||||||||
| 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 | |||||||||
Re:为什么连这么简单的一道题目都错了呢?请指教~~In Reply To:为什么连这么简单的一道题目都错了呢?请指教~~ Posted by:jimmyzzxhlh at 2005-04-03 11:49:47 > #include<iostream.h>
> int main()
> {
> int l,h,n,ok;
> char s[100];
> cin>>n;
> while (n != 0)
> {
> l = 1; h = 10; cin>>s; cin>>s; ok = 1;
> while (n != 0 & s[0] != 'o')
> {
> if (s[0] == 'h' & n < h) h = n - 1;
> if (s[0] == 'l' & n > l) l = n + 1;
> if (h < l) ok = 0;
> cin>>n;
> if (n != 0)
> {cin>>s; cin>>s;}
> }
> if (n < l || n > h) ok = 0;
> if (ok == 1) cout<<"Stan may be honest"<<endl;
> else cout<<"Stan is dishonest"<<endl;
> if (n != 0) cin>>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