求调
查看原帖
求调
1790923
Endeavour_楼主2025/7/24 19:48

样例过了,测试点1机上跑过了,但是不知道为什么答案清一色说我输出太短……

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int p1, p2, p3, i, start, end; char a[101], op;
	cin>>p1>>p2>>p3>>a;
	while (i<=strlen(a))
	{
		cout<<a[i];
		if (a[i+1]=='-' && a[i]!='-' && a[i+2]!='-' && a[i]<a[i+2] && a[i+2]-a[i]<26)
		{
			start=a[i];
			end=a[i+2];
			for (int j=start+1; j<end; j++)
			{
				if (p3==1) op=j;
				else if (p3==2) op=start+end-j;
				if (p1==2) op-=('a'-'A');
				else if (p1==3) op='*';
				for (int k=1; k<=p2; k++) cout<<op;
			}
			cout<<a[i+2];
			i+=3;
		}
		else i++;
	}
	return 0;
}
2025/7/24 19:48
加载中...