fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int tab[10], licznik = 0;
  6.  
  7. int main()
  8. {
  9. while(cin>>tab[0]>>tab[1])
  10. {
  11. for(int i=2; i<tab[1]+2; i++)
  12. {
  13. cin>>tab[i];
  14. if(tab[0]==tab[i])
  15. licznik++;
  16. }
  17. cout<<licznik<<endl;
  18. licznik = 0;
  19. }
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 3464KB
stdin
1 3 11 1 7
2 4 1 2 4 3
3 5 2 2 2 2 2
4 4 4 4 4 4
stdout
1
1
0
4