What wrog with this code!
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int counter=0,sum=0;
int T,n;
char string[100];
cout<<"Number of the words: "<<endl;
cin>>T;
if(T<=40)
{
cout<<"Enter the word: "<<endl;
do
{
gets(string);
n=strlen(string);
for(int i=0;i<n;i++)
{
if(string[i]=='A' || string[i]=='O' || string[i]=='D' || string[i]=='P' || string[i]=='R' || string[i]=='Q') counter++;
if(string[i]=='B') counter+=2;
sum+=counter;
}
T--;
}while(T>=0);
cout<<"Number of holes: "<<sum<<endl;
}
else
cout<<"You enter wrong number!"<<endl;
return 0;
}