|
|
back to boardwa test 5 Posted by garra 8 Feb 2012 08:51 here is my code #include<stdio.h> #include<stdlib.h> int main() {
int n,a[150],i,j,c[150]={0},s=0,r;
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d",&a[i]);
}
for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(a[i]==a[j]) { c[i]++; } } }
for(i=0;i<n;i++) { r=c[i]/4; s=s+r; }
if(n==c[0]) { printf("%d\n",c[0]/4); } else { printf("%d\n",s); }
return 0;
} |
|
|