-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcp46.cpp
40 lines (36 loc) · 786 Bytes
/
cp46.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[4];
for(int i=0;i<4; i++){
cin >> a[i];
}
sort(a, a+4);
int c =0;
if(a[0] == a[1] && a[1]== a[2] && a[2] == a[3]){
c = 3;
cout << c << endl;
return 0;
}
else if((a[0] == a[1]&& a[1] == a[2]) || (a[1] == a[2] && a[2] == a[3])){
c = 2;
cout << c << endl;
return 0;
}
else if(a[0] == a[1] && a[2] == a[3]){
c = 2;
cout << c << endl;
return 0;
}
else if(a[0] == a[1] || a[1] == a[2] || a[2] == a[3] || a[3] == a[4]){
c = 1;
cout << c << endl;
return 0;
}
else{
c = 0;
cout << c << endl;
return 0;
}
return 0;
}