#include <bits/stdc++.h>
using namespace std;
int main()
{
long long int i,j,k,l,m,n;
double v;
map<string,int>a;
map<string,int>::iterator it=a.begin();
string st,s;
char c,d;
//freopen("10226.txt","r",stdin);
//freopen("10226out.txt","w",stdout);
cin>>n;
for(i=1;i<=n;i++)
{
j=0;
k=0;
a.clear();
if(i==1)
{
cin.ignore();
cin.ignore();
}
while(getline(cin,st))
{
if(st=="")
{
break;
}
else
{
a[st]++;
j++;
}
}
for(it=a.begin();it!=a.end();it++)
{
cout<<it->first<<" ";
v=((double)(it->second)/(double)j)*100.00;
printf("%0.4lf\n",v);
}
if(i!=n)
{
cout<<endl;
}
}
return 0;
}
0 comments:
Post a Comment