URI Problem 1848 (Counting Crow) solution( Bangla ) | C language

**Before watching this make sure that you’ve tried enough**

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

int main()
{
    char ch[10];
    int n=0,k=0;
    for(;k!=3;){
        gets(ch);
        if(ch[0]=='*'){
            if(ch[1]=='-'){
                if(ch[2]=='-')n += 4;
                else n += 5;

            }
            else {
                if(ch[2]=='-')n += 6;
                else n += 7;
            }
        }
        else if(ch[0]=='-'){
            if(ch[1]=='-'){
                if(ch[2]=='-') n += 0;
                else n += 1;
            }
            else {
                if(ch[2]=='-')n += 2;
                else n += 3;
            }
        }
        if(ch[0]=='c'){
            printf("%d\n",n);
            k++;
            n=0;
        }
    }


    return 0;
}

 

If this solution helped you, please share this with your friends.
And if you have anything to say, let me know in the comment section.

More solutions are coming so Like our Facebook page and Subscribe to our YouTube channel to stay connected.

Leave a Comment