#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=1000;
int main(void)
{
int n,m;
int i,j,k,len;
string s1,s2;
while(cin>>s1)
{
cin>>s2;
i=s2[1]-'0';
len=s2[2]-'0';
if(s2[0]==0)
{
int k=i+len-1;
int l=k;
for(j=i;j<=k;j++)
swap(s[j],s[l--]);
}
else
{
}
}
}
未完成版
九度OJ_北邮_1117_字符串
最新推荐文章于 2021-05-19 19:54:02 发布
本文展示了一个使用C++进行字符串操作的示例程序。该程序读取两个字符串,从第二个字符串中解析出一个整数索引及长度,并根据这些信息来对第一个字符串中的字符进行重新排列。虽然当前代码片段并未完成全部逻辑实现,但提供了处理字符串的基本框架。
329

被折叠的 条评论
为什么被折叠?



