baher96
1
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;
}
}
damn_me
2
Please put proper indented code or paste the ideone link
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 : http://www.codechef.com/viewsolution/6095567
Hope You understood… 
baher96
5
i cant believe i made that return 0 mistake O.o thank you so much 