注意带空格的字符串的输入。
#include <iostream>
using namespace std;int main() {string a,b;getline(cin,a);getline(cin,b);for(int i=0;i<a.size();i++){int cnt=0;for(int j=0;j<b.size();j++){if(b[j]==a[i]){cnt=1;break;}}if(cnt==0)cout<<a[i];}
}
// 64 位输出请用 printf("%lld")
/*
struct ListNode {int val;struct ListNode *next;ListNode(int x) :val(x), next(NULL) {}
};*/
class Solution {
public:ListNode* FindFirstCommonNode( ListNode* pHead1, ListNode* pHead2) {ListNode* p=pHead1;ListNode* q=pHead2;while(p!=q){if(p!=NULL)p=p->next;elsep=pHead2;if(q!=NULL)q=q->next;elseq=pHead1;}return p;}
};
#include <iostream>
using namespace std;int main()
{int n = 0;cin >> n;string str;cin >> str;long s = 0; long h = 0; long y = 0; for(int i = 0; i < n; ++i){if(str[i] == 's'){s++;}else if(str[i] == 'h'){h += s;}else if(str[i] == 'y'){y += h;}}cout << y << endl;return 0;
}