Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int n, c, m, *pc, *pm, i, j, cont;
  5. while(scanf("%d %d %d", &n, &c, &m) == 3)
  6. {
  7. cont = 0;
  8. pc = malloc(c*sizeof(int));
  9. pm = malloc(m*sizeof(int));
  10. for(i = 0; i < c; ++i)
  11. {
  12. scanf("%d ", &pc[i]);
  13. }
  14. for(i = 0; i < m; ++i)
  15. {
  16. scanf("%d ", &pm[i]);
  17. }
  18. for(i = 0; i < c; ++i)
  19. {
  20. for(j = 0; j < m; ++j)
  21. {
  22. if(pc[i] == pm[j])
  23. {
  24. cont++;
  25. break;
  26. }
  27. }
  28. }
  29. printf("%d\n", c - cont);
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement