当前位置:网站首页>Good simple recursive problem, string recursive training
Good simple recursive problem, string recursive training
2022-04-23 05:08:00 【FOWng_ lp】

Topic link
https://www.luogu.com.cn/problem/P1928
Click here
Code
Easy to understand code answer
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
string dg(){
int cnt;
string s="",ss;
char c;
while(cin >> c){
if(c=='['){
cin >> cnt;
ss = dg();
while(cnt--)s+=ss;
}
else {
if(c==']')return s;
else s+=c;
}
}
}
int main(){
cout << dg();
return 0;
}
That's good !
版权声明
本文为[FOWng_ lp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220549345804.html
边栏推荐
- 【数据库】MySQL单表查询
- JS détermine si la chaîne de nombres contient des caractères
- Implementation of switching windows and capturing data in selenium mode
- Day. JS common methods
- Introduction to load balancing
- Innovation training (V) mid term inspection
- Acid of MySQL transaction
- Mac enters MySQL terminal command
- Define defines constants and macros, pointers and structures
- Knowledge points sorting: ES6
猜你喜欢
![[2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测](/img/7c/51ac43080d9721f1bdc1cd78cd685b.png)
[2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测

深度学习笔记 —— 物体检测和数据集 + 锚框

The applet calls the function of scanning QR code and jumps to the path specified by QR code

使用zerotier让异地设备组局域网

Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases

Details related to fingerprint payment

Sword finger offer: the median in the data stream (priority queue large top heap small top heap leetcode 295)

MySQL circularly adds sequence numbers according to the values of a column

直播带货表格模板-自动显示图片-自动关联系列商品

数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲
随机推荐
AQS源码阅读
2022/4/22
和谐宿舍(线性dp / 区间dp)
Innovation training (II) task division
【数据库】表的查看、修改和删除
Perfect test of coil in wireless charging system with LCR meter
什么是指令周期,机器周期,和时钟周期?
《2021多多阅读报告》发布,95后、00后图书消费潜力攀升
Discussion on flow restriction
[2021] Spatio-Temporal Graph Contrastive Learning
Progress of innovation training (III)
HRegionServer的详解
Learning Android V from scratch - UI
使用zerotier让异地设备组局域网
Docker installation and mysql5 7 installation
Get the number of days between dates, get the Chinese date, get the date of the next Monday of the date, get the working day, get the rest day
TypeError: ‘Collection‘ object is not callable. If you meant to call the ......
Leetcode 1547: minimum cost of cutting sticks
[2021] Spatio-Temporal Graph Contrastive Learning
Uglifyjs compress JS