fork download
  1. #include <stdio.h>
  2.  
  3. #define NUM 5
  4.  
  5. int main(void)
  6. {
  7. double a[NUM];
  8. int i, j;
  9. int count = 0;
  10.  
  11. for(i = 0; i < NUM; i++)
  12. {
  13. scanf("%lf", &a[i]);
  14. }
  15.  
  16. for(i = 0; i < NUM - 1; i++)
  17. {
  18. for(j = i + 1; j < NUM; j++)
  19. {
  20. if(a[i] == a[j])
  21. {
  22. count++;
  23. }
  24. }
  25. }
  26.  
  27. printf("%d\n", count);
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5308KB
stdin
1.0
1.2
1.3
1.0
1.0
stdout
3