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 |
求助 什么原因WA?#include<iostream> #include <vector> using namespace std; int main() { int n; cin>>n; while(n) { int count=0; vector<char>V; char ch[1000]; cin>>ch; int j=0; while(ch[j]!='\0') { int work; if(V.size()!=0) { work=1; for(int i=0;i<V.size();i++) { if(V[i]==ch[j]) { V.erase(V.begin()+i); work=0; break; } } if(work) { V.push_back(ch[j]); if(V.size()>n) count++; } } else V.push_back(ch[j]); j++; } if(count) { cout<<count<<" customer(s) walked away."<<endl; return 0; } else { cout<<"All customers tanned successfully."<<endl; return 0; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator