Find The Holes in A String

You might also like

You are on page 1of 1

FIND THE HOLES IN A STRING (ONLY UPPERCASE LETTERS)

program ta run korale onek moja paba.........just input deoer shomoy UPPERCASE LETTER hote hobe

#include<stdio.h>
... int main()
{ int t,count;
char c;
scanf("%d",&t);
getchar();
while(t--)
{ count=0;
while((c=getchar())!='\n')
{ if(c=='A'||c=='D'||c=='O'||c=='P'||c=='R'||c=='Q')
count++;
if(c=='B')
count=count+2;
}
printf("%d\n",count);
}
return 0;
}

You might also like