mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 100819P.cpp
This commit is contained in:
parent
27eb9dfd3b
commit
992ee0ae8b
24
Codeforces/Gym/100819P.cpp
Normal file
24
Codeforces/Gym/100819P.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user