直接模拟上_下_和走人就好
#include<bits/stdc++.h>
using namespace std;
int n;
void Gao()
{
string a;
map<char,int >mp;
cin>>a;
int tem=0,ans=0;
for (int i=0;i<a.length();i++)
{
if (mp.find(a[i])!=mp.end())
{
if(mp[a[i]]==2)
tem--;
}
else
{
if (tem==n)
mp[a[i]]=1,ans++;
else
tem++,mp[a[i]]=2;
}
}
if (ans==0)
cout<<"All customers tanned successfully."<<endl;
else
printf("%d customer(s) walked away.\n",ans);
}
int main()
{
//freopen("a.in","r",stdin);
while (cin>>n && n)
Gao();
return 0;
}