标签:
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6417 Accepted Submission(s): 3897
((((B)()))()) (B)
4 1#include<stdio.h> #include<string.h> int main() { int i,j,k,h; char x[1000]; while(scanf("%s",x)!=EOF) { j=strlen(x); for(i=0;i<j;i++) if(x[i]!='('&&x[i]!=')') k=i; h=0; for(i=0;i<k;i++) { if(x[i]=='(') h++; if(x[i]==')') h--; } printf("%d\n",h); } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/l15738519366/article/details/47090657