ACGO欢乐赛#42题解
2025-03-10 20:44:59
发布于:浙江
6阅读
0回复
0点赞
Solution
对于所有的 ,输出 遍 即可。
Code
#include <bits/stdc++.h>
#include <cstdio>
#define int long long
#define ull unsigned long long
#define mod 998244353
#define MOD 1000000007
using namespace std;
const int N = 2e6 + 5,maxn = 3e3 + 5;
const double goldnum = (sqrt (5) + 1) / 2;
inline int read ()
{
int x = 0;
bool f = 1;
char c = getchar ();
while (c < '0' || c > '9') f = (c == '-' ? !f : f),c = getchar ();
while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + (c ^ 48),c = getchar ();
return (f ? x : -x);
}
inline void write (int x)
{
if (x < 0) putchar ('-'),x = -x;
if (x > 9) write (x / 10);
putchar (x % 10 + '0');
return ;
}
signed main ()
{
int n;
cin >> n;
string s;
cin >> s;
for (int i = 0;i < n;i ++)
{
for (int j = 1;j <= i + 1;j ++) cout << s [i];
}
return 0;
}
这里空空如也
有帮助,赞一个