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