赞
踩
- #include <stdio.h>
- #include<string.h>
- char s[100] = "";
- int count[128] = { 0 };
- void compute()
- {
- for (int i = 0; i < strlen(s); i++)
- {
- count[s[i]]++;
- }
- }
-
- void output()
- {
- for (int i = 0; i < 128; i++)
- {
- if (count[i] != 0)
- printf("%c%d", i, count[i]);
- }
- }
-
- int main()
- {
- gets_s(s);
- compute();
- output();
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。