#include<stdio.h>
int main(void)
{
int T,i,j,N,A[1000];
int c=0;
clrscr();
printf(“enter the no. of test cases”);
scanf("%d", &T);
for(i=1;i<T;i++)
{
printf(“enter no. of players”);
scanf("%d", &N);
printf(“no. heard by the players”);
for(j=1;j<N;j++)
{
scanf("%d", &A[i]);
}
for(j=2;j<N;j++)
{
if(A[1]!=A[j])
{
c=c+1;
}
}
printf("%d", &c);
}
return 0;
}
this code is not giving the correct ANSWER
printf(“enter the no. of test cases”);
printf(“enter no. of players”);
You don’t add statements like that. The output should be as given in the problem statement. No need for statements like this.
Also
clrscr();
Don’t use that.
Is this part of the April Challenge? If it is, then delete this question immediately. You are not allowed to post code relating to an ongoing contest.
This is a part of the April challenge. Read the question carefully, you are missing out on a important piece.