228A

#include <stdio.h>
#include <stdlib.h>
 
int comp_inc(const void *first, const void *second);
 
int main()
{
	int a[5];
	int i;
	for(i=0; i<4; ++i)
	{
		scanf("%d", &a[i]);
	}
	qsort(a, 4, sizeof(a[0]), comp_inc);
	int Count=0;
	int ans=0;
	for(i=0; i<3; ++i)
	{
		if(a[i]==a[i+1])
			++Count;
		else
		{
			if(Count>0)
			{
				ans+=Count;
				Count=0;
			}
		}
	}
	if(Count>0)
		ans+=Count;
	printf("%d\n", ans);
	return 0;
}
 
int comp_inc(const void *first, const void *second)
{
	return *(int *)first-*(int *)second;
}

  

猜你喜欢

转载自www.cnblogs.com/ozxics/p/11248406.html
228