Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

wrong answer holes in text

$
0
0
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;

int main(){
int z[40],r,q,c=0;
char p[100];
cin>>q;
for( int i=0;i<q;i++){
gets(p);
r=strlen(p);
for(int j=0;j<r;j++){

if(p[j]=='A'||p[j]=='D'||p[j]=='O'||p[j]=='P'||p[j]=='Q'||p[j]=='R'){
c++;
}
else{
if(p[j]=='B'){
c=c+2;}
}
}
z[i]=c;
c=0;

}
for(int n=0;n<q;n++){
cout<<z[n];
cout<<endl;}
return 0;
}

plzz


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>