#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
struct e
{
char name[32];
int b;
}a[1000010];
int cmp(e a,e b)
{
return strcmp(a.name,b.name)<0;
}
int main()
{ int n=0;
int k=0,flag;
while(gets(a[n].name)&&strlen(a[n].name))
n++;
double op=100.0/n;
//printf("%lf",p);
sort(a,a+n,cmp);
int p=1;
for(int i=0;i<n;i++){
if(strcmp(a[i].name,a[i+1].name)==0) p++;
else {printf("%s %.4f\n",a[i].name,p*op);p=1;}
}
}
比较水,直接sort就能过,但是别的算法还没有学习到,以后遇到应该就需要算法了。