#include
using namespace std;
int main()
{
int test;
int i,j,hole=0;
char str[100];
cin>>test;
for(i=0;i<test;i++)
{
gets(str);
for(j=0;str[j]!='\0';j++)
{
if(str[j]=='Q'||str[j]=='R'||str[j]=='O'||str[j]=='P'||str[j]=='A'||str[j]=='D')
hole++;
else
if(str[j]=='B')
hole=hole+2;
}
cout<<hole<<endl;
}
}
why this program is printing 1st result as 0ā¦ and if i check it for ānā inputsā¦ it run only for 'n-1ātimesā¦
1st result always prints 0ā¦ rest all are correctā¦ someone plzz helpā¦