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=i+1)
  12. {
  13. scanf("%lf", &a[i]);
  14. }
  15.  
  16. for (i = 0; i < NUM; i=i+1)
  17. {
  18. for (j = i + 1; j < NUM; j=j+1)
  19. {
  20. if (a[i] == a[j]) {
  21. count=count+1;
  22. }
  23. }
  24. }
  25.  
  26. printf("%d", count);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5316KB
stdin
1.0
1.2
 1.3
 1.0
 1.0
stdout
3