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> #include<string> using namespace std; int main() { int n[100],k; while(cin>>n[0]) { k=cin.get(); if(!n[0])return 0; char m[100][10]={'\0'},a[9]="right on",b[9]="too high",c[8]="too low"; int i(1),j,z(0); cin.getline(m[0],10); if(!strcmp(m[0],a))cout<<"Stan may be honest";else{ while(i<100) { cin>>n[i];k=cin.get(); cin.getline(m[i],10); if(!strcmp(m[i],a))break; i++; } for(j=0;j<i;j++) { if(!strcmp(m[j],b)) { if(n[j]>n[i])z++; else cout<<"Stan is dishonest"<<endl; } if(!strcmp(m[j],c)) { if(n[j]<n[i])z++; else cout<<"Stan is dishonest"<<endl; } if(z==i)cout<<"Stan may be honest"<<endl; }} memset(n,0,100);} return 0; } 帮个忙吧 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator