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

holes in the text wrong answer

$
0
0
#include <stdio.h>
#include <string.h>

int main()
{
    int hole=0;
    int i;
    char word[100];

    scanf("%s",&word);
    fflush(stdin);

    i=strlen(word);

    for(i=0;i<=40;i++)
    {
        if(word[i]=='A' || word[i]=='D' || word[i]=='O' || word[i]=='P' || word[i]=='R' || word[i]=='Q' )
        {
            hole++;
        }

        if(word[i]=='B')
        {
            hole+=2;
        }

        if(word[i]>=0 && word[i]<=9)
        {
            break;
        }

    }
        printf("%d",hole);

    getchar();
    return 0;

}

Viewing all articles
Browse latest Browse all 40121

Trending Articles



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