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<vector> using namespace std; template <typename T> bool f(vector<T> high, vector<T > low,int n) { int i,j; for( i=0;i!=high.size();i++) { for( j=0;j!=low.size();j++) if(high[i]<=low[i]||low[j]>=n||high[i]<=n) return false ; } return true; } int main() { vector<int >high,low; int n; char a[6],b[6]; while(cin>>n&&n!=0) { cin>>a>>b; if(b[0]=='h') high.push_back(n); if(b[0]=='l') low.push_back(n); if(a[0]=='r') { if(f(high,low,n)) { cout<<"Stan may be honest"<<endl; } else { cout<<"Stan is dishonest"<<endl; } high.clear();low.clear(); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator