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

getting a runtime error

$
0
0

include<stdio.h>

include<string.h>

int main() { int T,i; scanf("%d",&T); for(i=0;i<T;i++) { int K,N,j; //array of strings scanf("%d%d",&N,&K); char A[N][100]; char B[10][100][100]; for(j=0;j<N;j++) { scanf("%s",A[j]); // N strings denoting a dictionary of the forgotten language. } int L,k; for(j=0;j<K;j++) {

    scanf("%d",&L);

    for(k=0;k<L;k++)
    {
    //input of the fraces
    scanf("%s",B[j][k]);

    }
}

int flag,l;
for(j=0;j<N;j++)
{

    for(k=0;k<K;k++)
    {   flag=0;
        for(l=0;l<L;l++)
        {
            if(strcmp(A[j],B[k][l])==0)
          {
            flag=1;
            break;
            }
        }

    }
    if(flag==1)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
}

} }


Viewing all articles
Browse latest Browse all 40121

Trending Articles



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