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