#include<stdio.h>
int main()
{
int count = 0;
int ch=0;
while ((ch = getchar()) != EOF)
{
if (ch == '{')
{
count++;
}
else if (ch == '}')
{
if (count > 0)
count--;
else if (count == 0)
{
printf("不匹配\n");
return 0;
}
}
}
if (count==0)
{
printf("匹配\n");
}
else
{
printf("不匹配\n");
}
system("pause");
return 0;
}
int main()
{
int count = 0;
int ch=0;
while ((ch = getchar()) != EOF)
{
if (ch == '{')
{
count++;
}
else if (ch == '}')
{
if (count > 0)
count--;
else if (count == 0)
{
printf("不匹配\n");
return 0;
}
}
}
if (count==0)
{
printf("匹配\n");
}
else
{
printf("不匹配\n");
}
system("pause");
return 0;
}