[mw_shl_code=c,true]#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
string s;
char stack[250];
void push(int & top,char ch) {
top++;
stack[top]=ch;
}
void pop(int & top) {
top--;
}
int main()
{
freopen("5.in","r",stdin);
freopen("5.out","w",stdout);
int i,top;
char ch;
i=0;
top = 0;
cin>>s;
ch = s;
while (ch!='?') {
if (ch == '(') {
push(top,ch);
} else if (ch == ')') {
if (top ==0) {
cout<<"no"<<endl;
return 0;
} else pop(top);
}
i++;
ch=s;
}
if (top ==0 )
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
//cout<<s;
return 0;
}
[/mw_shl_code] |