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

引领天下

2018-05-22 21:06:23

Solution

这题怎么没人做呢…… 其实看了我的[翻译](https://www.luogu.org/discuss/show?postid=43551)就知道是求4个数里有几个重复的-1 所以很简单了 代码很短就不写注释了 ```cpp #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); } ```