简介

简单

code

#include <iostream>
#include <string>
#include <map>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    string t;
    cin >> t;
    map<char, int> cc;
    for(auto it : s){
        if(it >='a' && it <= 'z') cc[it-'a' + 'A']++;
        else cc[it]++;
    }
    if(t[0] >='a' && t[0] <='z') cout << cc[t[0] - 'a' + 'A'] << endl;
    else cout << cc[t[0]] <<endl;
    return 0;
}
posted on 2021-06-22 16:01  HDU李少帅  阅读(73)  评论(0编辑  收藏  举报