enormous input test

#include<stdio.h>
int main()
{
int i=0,n,c=0;
long k,t;
scanf("%d%l",&n,&k);
if(k<=10000000)
{
while(i<n)
{
scanf("%l",&t);
if(t<=1000000000)
{
if(t%k==0)
c++;
}

i++;
}
printf("%d",c);
}
return 0;
}

i want to knw what is wrong in my code… how can i make it right

use %ld for inputting and outputting long integers , you have used %l , your code is accepted then :slight_smile:

here is your corrected code

ideone link

1 Like