超绝题解
2025-03-25 20:28:11
发布于:上海
4阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
int l=s.size();
int cnt=0;
for(int i=0;i<l;i++){
for(int j=i+1;j<l;j++){
for(int k=j+1;k<l;k++){
if(s[i]'K'&&s[j]'M'&&s[k]=='P')
cnt++;
}
}
}
cout<<cnt;
return 0;
}
这里空空如也
有帮助,赞一个