Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<cstdlib>
- #include<cmath>
- #include<cctype>
- #include<cstring>
- #include<iostream>
- #include<string>
- #include<algorithm>
- #include<vector>
- #include<queue>
- #include<stack>
- #include<set>
- #include<map>
- #define mset(a,v) memset(a,v,sizeof(a))
- #define read freopen("input.c","r",stdin)
- #define write freopen("output.txt","w",stdout)
- #define ll long long
- #define pii pair<int,int>
- using namespace std;
- char s[100000];
- int a[200];
- int main(void)
- {
- int t;
- cin>>t;
- getchar();
- for(int i=1;i<=t;i++){
- gets(s);
- int l;
- l = strlen(s);
- for(int j=0;j<l;j++){
- a[(int)s[j]]++;
- }
- printf("Case %d:\n",i);
- for(int j=0;j<200;j++)
- if(a[j]!=0)
- cout<<(char)j<<" "<<a[j]<<endl;
- mset(a,0);
- mset(s,0);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement