fork(50) download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char** argv) {
  4. int a, i, j, c = 0;
  5. scanf("%d", &a);
  6. int vetor[a];
  7. for (i = 0; i < a; i++) {
  8. scanf("%d", &vetor[i]);
  9. }
  10. for (i = 0; i < a; i++) {
  11. for (j = i + 1; j < a; j++) {
  12. if (vetor[i] == vetor[j]) {
  13. c++;
  14. }
  15. }
  16. }
  17. printf("%d\n", c);
  18. return 0;
  19. }
Success #stdin #stdout 0s 9432KB
stdin
5 10 11 12 12 13
stdout
1