#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
int in[200];
char scch;
memset(in,0,sizeof(int) * 200);
scch = getchar();
for(;scch != '\n';scch = getchar()){//接收字符串也有可能超时。
in[scch] ++;
}
char tempch = getchar();
for(;tempch != '\n';tempch = getchar()){
if(tempch >= 'A'&&tempch <= 'Z'){
if(in['+'] != 0){
continue;
}
}
if(in[tempch] == 0){
if(tempch >= 'a'&&tempch <= 'z'){
if(in[tempch - 'a' + 'A'] != 0){
continue;
}
}
printf("%c",tempch);
}
}
return 0;
}

本文介绍了一个使用C++实现的字符频率统计程序,该程序读取输入字符串,并统计每个字符出现的次数。此外,它还具备过滤功能,能够忽略已出现过的字符,仅输出未出现过的字符。通过使用标准C++库如iostream、cstdio和cstring,程序实现了高效的字符处理。
214

被折叠的 条评论
为什么被折叠?



