用递归,题目见:logo语言 - 洛谷
#include <stdio.h>
char s[100000];
int dfs(char *p)//前进和后退很简单
{
//char *p=s;
int n=0;
while(*p!='\0')
{
if(*p=='F')
{
while(*p>'9'||*p<'0')
p++;
int m=0;
while(*p>='0'&&*p<='9')
{
int key=*p-'0';
m=m*10+key;
p++;
}
n+=m;
}
else if(*p=='B')
{
while(*p>'9'||*p<'0')
p++;
int m=0;
while(*p>='0'&&*p<='9')
{
int key=*p-'0';
m=m*10+key;
p++;
}
n-=m;
}
else if(*p=='R')//重复,即将子段临时构建成以\0为结尾的合法字符串
{
while(*p>'9'||*p<'0')
p++;
int m=0;
while(*p&g