| ||||||||||
| 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 <iostream>
using namespace std;
int main()
{
int var;
char dicats[9];
int high_var=10,low_var=0;
while ( cin >> var)
{
while (cin>>dicats)
{
if("too high"== dicats)
{
high_var=var;
continue;
}
else{
if("too low"==dicats)
{
low_var=var;
continue;
}
else{
if( "right on"==dicats)
{
if(high_var<=low_var) cout<<"Stan is dishonest\n";
else cout<<"Stan may be honest\n";
break;
}
}
}
}
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator