HOLES wrong answer

enter code here

#include 
using namespace std;

int main() 
{
    int t,i,j,count;
    string str;
    cin>>t;
    while(t--)
    {
    	count=0;
        cin>>str;
        for(j=0;j<str.length();j++)
        {
            if(str[j]=='B')
                count+=2;
            else if(str[j]=='O' || str[j]=='Q' || str[j]=='A' || str[j]=='P' || str[j]=='D' || str[j]=='R')
                count++;
            else
            	count+=0;
        }
        cout<<count;
        return 0;
 
    }    
 }

Please if you ask a question, paste your code on ideone and include a link here.

About your error…

Bug 1: you have included return 0 inside while loop due to which your code work for only first test case.

Bug 2: You are not printing result in newline.

Solutions :

remove return 0 from while loop and add endl after cout<< count.

Here is your AC version code : CodeChef: Practical coding for everyone

Hope You understood… :slight_smile:

Please put proper indented code or paste the ideone link

sorry for that

i cant believe i made that return 0 mistake O.o thank you so much :slight_smile:

welcome… :slight_smile: