题解 CF228A 【Is your horseshoe on the other hoof?】

这题怎么没人做呢……

其实看了我的翻译就知道是求4个数里有几个重复的-1

所以很简单了

代码很短就不写注释了

1
2
3
4
5
6
7
8
9
#include <bits/stdc++.h>
using namespace std;
int a[4],ans;
int main(void){
scanf ("%d%d%d%d",&a[0],&a[1],&a[2],&a[3]);
sort (a,a+4);
for (int i=1;i<4;i++)if (a[i]==a[i-1])ans++;
printf ("%d",ans);
}