برنامه ای بنویسید که درستیه باز و بسته بودن پرانتز هارا تشخیص بدهد؟

نمونه ورودی

((HI)T))SADR(F

نمونه خروجی

wrong

نمونه ورودی

(((onlingram)tel)o)

نمونه خروجی

wrong

سورس کد

#include<iostream>
using namespace std;
int main()
{
unsigned int arr[30], j=0;
char txt[30];
cin>>txt;
for(unsigned int i=0;i<strlen(txt);i++)
{
if( txt[i] == '(' )
{
j++;
arr[j]=1;
}
if( txt[i] == ')' )
{
j--;
arr[j]=0;
}
}
if(arr[0] == NULL)
{
cout<<"Correct"<<endl;
}
else
cout<<"Wrong";
return 0;
}