0分,已心碎,求调
查看原帖
0分,已心碎,求调
1458355
CHIHUIZY楼主2025/7/24 11:19
#include<iostream>
using namespace std;
string zyc(int a,int b,string c,string s)
{
	string zy=s;
	long long e=0;
	for(int j=a-1;j<b;j++)
	{
		zy[j]=c[e];
		e++;
	}
	return zy;
}
void zyc1(string s)
{
	long long e=0,sum=0;
	while(s[e+1])
	{
		if(s[e]=='1') sum++;
		e++;
	}
	cout<<sum%99824353<<" ";
}
void zyc2(string s)
{
	long long e=0,sum=0;
	while(s[e])
	{
		sum+=int(s[e]-'0');
		e++;
	}
	cout<<sum%99824353<<" ";
}
void zyc3(string s)
{
	long long e=0,sum=1;
	while(s[e])
	{
		sum*=int(s[e]-'0'); 
		e++;
	}
	cout<<sum%99824353<<" "<<endl;
}
signed main(){
	string s;cin>>s;
	int n;cin>>n;
	for(int i=1;i<=n;i++)
	{
		int a,b;
		string c;
		cin>>a>>b>>c;
		string ans=zyc(a,b,c,s);
	    zyc1(ans);
		zyc2(ans);
		zyc3(ans);
	}	
	return 0;
}
2025/7/24 11:19
加载中...