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

why tle show up?

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

int main()
{
    long long int t;
    char s[500001];
    long long int i=0,length=0,jump=0,day=0;

    scanf("%Ld",&t);
    while(t--)
    {
        scanf("%s",&s);
        while(s[i]!='\0')
        {
            if(s[i]=='.')
            length++;
            else
            {
                if(jump>=length)
                length=0;
                else
                {
                    day++;
                    jump=length;
                    length=0;
                }
            }
            i++;

        }
        printf("%lld",day);
        printf("\n");
        memset(s,0,sizeof(s)*sizeof(char));
        i=0;length=0;jump=0;day=0;
    }
    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>