20分求解!
查看原帖
20分求解!
989143
Nahida_Official楼主2023/9/19 22:27
#include<bits/stdc++.h>
using namespace std;
string k,lll;
int l,m,n,q,b;
int ukl;
int main(){
	q=1;
	cin>>k;
	l=k.length();
	m=l+1;
	n=m*l/2;
	for(int i=0;i<n;i++){
		for(int j=b;j<l;j++){
			lll=k.substr(b,q);
			if(lll=="luogu"){
				ukl++;
			}
			q++;
		}
		b++;
		q=1;
	}
	cout<<ukl<<endl;
	return 0;
}
2023/9/19 22:27
加载中...