please help me in this simple problem

i am not able to understand what is the mistake i am doing in this program?http://ideone.com/8lWeoX

link is broken

link is broken

link not working

#include
using namespace std;
int main()
{
int t,i,J;
char a[100];
cin>>t;
for(i=0;i<t;i++)
{
int count=0;
gets(a);
for(int j=0;a[j]==’\0’;i++)
{
if((a[j]==‘A’)||(a[j]==‘D’)||(a[j]==‘O’)||(a[j]==‘P’)||(a[j]==‘Q’||)(a[j]==‘R’))
{
count=count+1;
}
if(a[j]==‘B’)
{
count=count+2;
}
}
cout<<count;
}
return 0;
}