Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define pi acos(-1.0)
- //cout << fixed << setprecision(8) << a << endl;
- //cout << "Case " << ca << ": " << ans << endl;
- #define Fast_Input ios_base :: sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
- int main()
- {
- int t,j;
- cin >> t;
- getchar();
- for(j=1; j<=t; j++)
- {
- if(j!=0)
- cout<<endl;
- double c=0,i=0;
- map < string,int > m;
- string s;
- while(getline(cin,s) && s.length()!=0)
- {
- i++;
- m[s]++;
- }
- for(auto x:m)
- {
- cout << x.first << " ";
- double y,z;
- z=x.second;
- y=((z*100)/i);
- cout << fixed << setprecision(4) << y << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment