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 |
神奇的程序 G++:WA C++:AC#include <iostream> #include <string> using namespace std; int main(){ int in=1; string o1,o2; int max,min; bool preright; cin>>in; max=11; min=0; while (in!=0){ cin>>o1>>o2; if (o1=="right"&&o2=="on"){ if (min<in&&in<max&&preright) {cout<<"Stan may be honest\n"; } else {cout<<"Stan is dishonest\n";} cin>>in; max=11; min=0; preright=true; continue; }else if(o1=="too"&&o2=="high"){ if (in<min) preright=false; if (in<max) max=in; }else if(o1=="too"&&o2=="low"){ if (in>max) preright=false; if (in>min) min=in; } if (max<=min) preright=false; cin>>in; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator