蒟蒻求助
查看原帖
蒟蒻求助
809165
The_Wandering_Earth楼主2023/1/22 19:07

rt,下面这个是P3719的代码,提交可以AC,但是在本地不知道什么情况没有输出,请大佬解答

#include<bits/stdc++.h>
using namespace std;
int work(){
	int s=0;
	char c;
	while(cin>>c){
		if(c==')')return s;
		if(c=='(')s+=work();
		if(c=='a')s++;
		if(c=='|')return max(s,work());
	}
	return s;
	
} 
int main(){
	cout<<work();
	return 0;
}
2023/1/22 19:07
加载中...