10 pts 没过样例但始终没调出来
  • 板块P1928 外星密码
  • 楼主02Ljh
  • 当前回复2
  • 已保存回复2
  • 发布时间2022/5/20 19:45
  • 上次更新2023/10/28 01:02:34
查看原帖
10 pts 没过样例但始终没调出来
578004
02Ljh楼主2022/5/20 19:45

//在处理'['上感觉有问题

//但始终没调出来

//P3719
#include <bits/stdc++.h>
using namespace std;
string s;
char ch;
string deal()
{    while(scanf("%c",&ch)!=EOF)
    {
        if(ch=='[') return deal();
        if(isdigit(ch))
        {
        	string ss=deal();
            for(int o=0;o<ch-'0';o++)
            {
            	//ss);
                s+=ss;
            }
            return s;
        }
        if(ch==']') return s;
        else  
        {
            s+=ch;
        }
    }
    return s;
}
int main()
{
	string s1=deal();
	for(int i=0;i<s1.size();i++)
	{
		cout<<s1[i];
	}
    return 0;
}
2022/5/20 19:45
加载中...