holes in the text-WRONG ANSWER

//this program is running succesfully…but the codechef admin does not accept it…why so??

#include<stdio.h>
#include<string.h>
int main()
{
 char a[100];
 int i,c,t;
 scanf("%d",&t);
 while(t!=0)
 {      scanf("%s",a);
	c=0;
	for(i=0;i<strlen(a);i++)
	{

		if((a[i]=='A')|| (a[i]=='P')||(a[i]=='D')||(a[i]=='R')||(a[i]=='O')||(a[i]=='Q'))
			c++;
		else if(a[i]=='B')
			c=c+2;
	}
	printf("%d",c);
	t--;
 }
 return 0;
}
1 Like

Have you tried multiple test cases? You are not printing a new line between each test cases…

5 Likes

Exactly , you are missing a ‘\n’ after printf(“%d”,c) ; , so please do that

Here is your accepted code CodeChef: Practical coding for everyone .

Happy Coding :slight_smile:

6 Likes