Create 100819P.cpp

pull/35/head
Kirigaya Kazuto 2016-08-14 17:51:14 +08:00 committed by GitHub
parent 27eb9dfd3b
commit 992ee0ae8b
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
char buffer[1024];
int bucket[26];
bool cmp(const int& a,const int& b)
{
return a>b;
}
int main()
{
gets(buffer);
int L=strlen(buffer);
for(int i=0;i<L;i++) ++bucket[buffer[i]-'a'];
sort(bucket,bucket+26,cmp);
int sum=0;
for(int i=2;i<26;i++) sum+=bucket[i];
printf("%d\n",sum);
return 0;
}