当前位置:网站首页>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
边栏推荐
- One month countdown, pgconf What are the highlights of the latest outlook of asia2021 Asian Conference?
- Mac 进入mysql终端命令
- The 8 diagrams let you see the execution sequence of async / await and promise step by step
- Acid of MySQL transaction
- Independent station operation | Facebook marketing artifact - chat robot manychat
- Leetcode -- heuristic search
- Deep learning notes - fine tuning
- Deep learning notes - object detection and dataset + anchor box
- [2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测
- Unity C e-learning (IV)
猜你喜欢
[database] MySQL multi table query (I)
AQS source code reading
Wine (COM) - basic concept
What are the redis data types
Independent station operation | Facebook marketing artifact - chat robot manychat
Download PDF from HowNet (I don't want to use CAJViewer anymore!!!)
Define defines constants and macros, pointers and structures
深度学习笔记 —— 微调
[winui3] write an imitation Explorer file manager
Redis data type usage scenario
随机推荐
Mac enters MySQL terminal command
Live delivery form template - automatically display pictures - automatically associate series products
Set Chrome browser background to eye protection (eye escort / darkreader plug-in)
#define 定义常量和宏,指针和结构体
Deep learning notes - data expansion
Knowledge points sorting: ES6
Sword finger offer: symmetric binary tree (recursive iteration leetcode 101)
Unique primary key ID of tidb sub table -- solution to failure of sequence and Gorm to obtain primary key
MySQL uses or to query SQL, and SQL execution is very slow
Golang select priority execution
持续集成(CI)/持续交付(CD)如何彻底改变自动化测试
MySQL realizes row to column SQL
Use the built-in function of win to transfer files between two computers in the same LAN (the speed is the same as that between local disks)
Acid of MySQL transaction
Discussion on flow restriction
[WinUI3]编写一个仿Explorer文件管理器
[2022 ICLR] Pyramid: low complexity pyramid attention for long range spatiotemporal sequence modeling and prediction
Solve valueerror: argument must be a deny tensor: 0 - got shape [198602], but wanted [198602, 16]
js 判斷數字字符串中是否含有字符
Innovation training (V) mid term inspection