mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-02-17 14:47:04 +00:00
parent
21b545d685
commit
e17d22d053
35
problem/P1928/P1928.cpp
Normal file
35
problem/P1928/P1928.cpp
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user