70分求助
查看原帖
70分求助
245459
liuchenyi0203楼主2022/1/18 11:48

rt,不知道哪里错了啊

// LG-P1739.cpp
#include <iostream>
#include <string>
using namespace std;
int pos=0,cnt=0;
char a[260];
int main(){
	for(int i=0; ;i++){
		cin>>a[i];
		if(a[i]=='@') break;
		if(a[i]=='(') pos++;
		else if(a[i]==')') cnt++;
	}
	if(pos!=cnt){
		cout<<"NO";
		cout<<endl;
	}
	else{
		cout<<"YES";
		cout<<endl;
	}
	return 0;
}

还希望dalao神犇帮助

2022/1/18 11:48
加载中...