fork download
  1. #include<iostream>
  2. #include<cstdio>
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7. int n,k,t,i,a,count=0;
  8. scanf("%d %d",&n,&k);
  9. i=0;
  10. while(i<n)
  11. {
  12. scanf("%d",&a);
  13. if(a%k==0)
  14. count=count+1;
  15. i++;
  16. }
  17. printf("%d\n",count);
  18. return 0;
  19. }
Success #stdin #stdout 0s 3100KB
stdin
7 3
1
51
966369
7
9
999996
11
stdout
4