delete pics to save space
This commit is contained in:
24
1.1739.cpp
Normal file
24
1.1739.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include<cstdio>
|
||||
#include<stack>
|
||||
using namespace std;
|
||||
stack<char> stk;
|
||||
int main()
|
||||
{
|
||||
char t;
|
||||
while(t=getchar(),t!='@')
|
||||
{
|
||||
if(t=='(') stk.push('(');
|
||||
else if(t==')')
|
||||
{
|
||||
if(stk.empty())
|
||||
{
|
||||
printf("NO\n");
|
||||
return 0;
|
||||
}
|
||||
if(stk.top()=='(') stk.pop();
|
||||
}
|
||||
}
|
||||
if(stk.size()==0) printf("YES\n");
|
||||
else printf("NO\n");
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user