原题

题目大意
我也不知道怎么说……
For example, if s=“bab” the process is: “b” → “baa” → “baabbb”. So the encrypted s=“bab” is “baabbb”.
就是这样
题目分析
比签到题还水的题,我也没什么好说的了(刚刚去瞄了一眼standing,没做出来的应该不是集训队的吧)
代码
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
using std::cin;
using std::string;
int main()
{
string a;
int n,i,j = 0;
cin >> n >> a;
for (i = 0;i < n;i += j)
{
putchar(a[i]);
j++;
}
return 0;
}
因为上两题的折磨,所以这次我直接上string了【雾
本文介绍了一个简单的字符串处理问题,通过特定规则将原始字符串转换为加密形式。示例中,如果s为“bab”,则经过一系列变换后得到的加密字符串为“baabbb”。文章提供了C++实现代码,采用string类型进行操作。
280

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



