第三组样例的数据到底是啥 好迷啊

P1739 表达式括号匹配

@[帽子](/space/show?uid=94690) 如果最后一个是 )呢
by Carbon @ 2018-09-15 00:03:01


@[帽子](/space/show?uid=94690) 上行作废
by Carbon @ 2018-09-15 00:04:45


捞一下
by 帽子 @ 2018-09-15 16:01:38


``` #include <iostream> #include <stdio.h> #include <cstring> #include <string> using namespace std; char c; int sum; int main() { // (()))(()@ while(c=getchar()) { if(c=='@') break; if(c=='(') sum++; if(c==')') sum--; if(sum<0) { cout<<"NO"; return 0; } } if(sum!=0) cout<<"NO"; else cout<<"YES"; return 0; } ```
by shiys2007 @ 2018-09-16 16:02:30


|