⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 统计字符.txt

📁 浙江大学研究生复试上机题目及解答。欢迎大家下载。
💻 TXT
字号:
//test
#include <cstdio>
#include <string>
#include <cmath>
#include <stack>
#include <algorithm>
using namespace std;
int alph[300];
char str[300],str2[300];
void hash() {
    int i;
    for (i=0;str2[i];i++) {
        alph[ str2[i] ] ++;
    }
}
int main() {
    int i;
    while (gets(str)) {
        if (str[0] == '#' && str[1] == 0) break;
        memset(alph,0,sizeof(alph));
        gets(str2);
        hash();
        for (i=0;str[i];i++) {
            printf("%c %d\n",str[i],alph[ str[i] ]);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -