#include
#include
#include
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tc;
int c;
cin >>tc;
while (tc--)
{
c = 0;
char str[100];
cin >> str;
int len = strlen(str);
if (str[0] == '<' && str[1] == '/' && str[len - 1] == '>')
{
for (int i = 2; i < len - 1; i++)
{
if (str[i] >= 'a' && str[i] <= 'z' || str[i] >= '1' && str[i] <= '9')
{
c = 1;
}
else
c=0;
}
}
if (c == 1)
cout << "Success" << endl;
else
cout << "Error" << endl;
}
return 0;
}
This solution for the HTMLTAGS problem is working on codeblocks as well as visual studio but its giving the SIGREV/SIGBART error when i try to submit it…Why is not working, and is there any issue with the code?