holes in the text problem(pls show ma error)

#include
using namespace std;

char a[100];
bool one(char a)
{
     if(a=='A' || a=='D' || a=='O' || a=='P' || a=='Q')
     {
           return true;
     }
    else
    return false;
}
bool two(char a)
{
       if(a=='B')
       return true;
       else
       return false;
}
 
int main()
{
     int x;
     int count;
     cin>>x;
     for(int i=0;i<x;++i)
     {


          count=0;
          cin>>a;
          for(int i=0;a[i]!='\0';++i)
          {
               if(one(a[i]))
               { ++count;
                continue;
               }
               else if(two(a[i]))
               {
                count=count+2;
                continue;
               }
          }
          cout<<count<<"\n";
       }
return 0;
}

u have missed the char “R”…!!!

this is the only error that i m able to see on the first look…add R in the if condition and mostly the code should get AC…hope this helps…:slight_smile:

1 Like

got correct…reali thanks

1 Like

glad could help…:slight_smile:

//