fork(1) download
  1. #include<stdio.h>
  2.  
  3. int main(void)
  4. {
  5. long int n,k,i,temp=0;
  6.  
  7. scanf("%ld %ld",&n,&k);
  8. while(n--)
  9. {
  10. scanf("%d",&i);
  11.  
  12. if (i%k==0)
  13. {
  14. temp++;
  15. }
  16.  
  17. }
  18. printf("%ld",temp);
  19. return 0;
  20. }
Success #stdin #stdout 0s 2296KB
stdin
5 3 
1 
2 
3 4 5 
stdout
1