题目链接:https://www.nowcoder.com/practice/a35ce98431874e3a820dbe4b2d0508b1?tpId=37&tqId=21224&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D1%26tpId%3D37%26type%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=
题目如下:
#includeusing namespace std; int main(){ string str; char ch; getline(cin,str);//读入一整行数据到str中 cin>>ch; int res=0; int flag=-1; if(isalpha(ch)>0) flag=1;//判断要查询的是否是字母 for(auto e:str){ if(flag==1&&(e==ch||abs(e-ch)==32)) res++;//abs(X):X的绝对值 else if(flag==-1&&e==ch) res++; } cout<



