| ||||||||||
| 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 | |||||||||
这题这样应该ac呀!怎么过不了?#include<iostream>
using namespace std;
int main(){
int n;
int x[13] ={0};
char str[13],str1[13];
while(1){
cin>>n;
if(n == 0)
break;
cin>>str>>str1;
strcat(str,str1);
if(strcmp(str,"toohigh")==0)
x[n] = 1;
else if(strcmp(str,"toolow")==0)
x[n] = 2;
else if(strcmp(str,"righton")==0){
int i,flg = 0;
for(i = 0;i<11;i++){
if(x[i]==1&&i<=n)
flg = 1;
if(x[i]==2&&i>=n)
flg = 1;
x[i] = 0;
}
if(flg == 0)
cout<<"Stan may be honest\n";
else
cout<<"Stan is dishonest\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