Search found 1 match

by Abid_CU
Fri Nov 13, 2015 11:43 am
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 79366

Re: 673 - Parentheses Balance, please see whats the problem here?

#include<stdio.h>
#include<string.h>
int main()
{
int t,i,j,len,flag;
char s[5000], tm[5000];
scanf("%d", &t);
getchar();
while(t--)
{
gets(s);
len= strlen(s);
flag=0;
j=0;
for(i=0; i<len; i++)
{
if(s[i]=='('||s[i]=='[') tm[j++]= s[i];
else
{
if(s[i]==')')
{
if(tm[j-1]=='(')
{
j ...

Go to advanced search