0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 04:58:48 +00:00

P1928 外星密码

https://www.luogu.com.cn/record/38657002
This commit is contained in:
Baoshuo Ren 2020-09-20 15:21:40 +08:00 committed by Baoshuo Ren
parent 21b545d685
commit e17d22d053
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

35
problem/P1928/P1928.cpp Normal file
View File

@ -0,0 +1,35 @@
// https://www.luogu.com.cn/record/38657002
#include <bits/stdc++.h>
using namespace std;
string cnm() {
int n;
char ch;
string s = "";
string str = "";
while (cin >> ch) {
if (ch == '[') {
cin >> n;
str = cnm();
while (n--) {
s += str;
}
}
else if (ch == ']') {
return s;
}
else {
s += ch;
}
}
return s;
}
int main() {
cout << cnm() << endl;
return 0;
}