Holes : Why is this code not being accepted ? This is done on c++(gcc-4.3.2)

#include
#include
using namespace std;

int main(){
int t;
char string[99];
cin>>t;

	while(t--){
		cin>>string;
	    int l=strlen(string);
		int count=0;
		for(int i=0;i<l;i++){
			
		    char newString=string[i];
			if(newString=='A'||newString=='D'||newString=='O'||newString=='P'||newString=='R')
			count++;
			else if(newString=='B')
			count+=2;
			
			
		}cout<<count<<endl;
		
		
	}
	
	return 0;
}

It works fine on my system . I am using DevCPP 5.8.3(TDM - GCC-4.8.1)

There is one more character with one hole.

1 Like