fork download
  1. #include <stdio.h>//試験個人回答
  2. #define NUM 6
  3. int main() {
  4. int i,j,count=0;
  5. double a[NUM];
  6. for(i=0;i<NUM;i++)
  7. {
  8. scanf("%lf",&a[i]);
  9. }
  10.  
  11. for(i=0;i<NUM;i++)
  12. {
  13. for(j=i+1;j<NUM;j++)
  14. {
  15. if(a[i]==a[j]) count++;
  16. }
  17. }
  18. printf("%d",count);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5312KB
stdin
1.0 1.1 1.2 1.3 1.0 1.0
stdout
3