We have five cards with integers $A$, $B$, $C$, $D$, and $E$ written on them, one on each card. This set of five cards is called a Full house if and only if the following condition is satisfied: Determine whether the set is a Full house.Problem Statement
Constraints
Input
Input is given from Standard Input in the following format:
$A$ $B$ $C$ $D$ $E$
Output
If the set is a Full house, print Yes
; otherwise, print No
.
Sample Input 1
1 2 1 2 1
Sample Output 1
Yes
The set has three cards with $1$ written on them and two cards with $2$ written on them, so it is a Full house.
Sample Input 2
12 12 11 1 2
Sample Output 2
No
The condition is not satisfied.
#include<bits/stdc++.h>
using namespace std;
int a[5];
int main()
{
for(int i=0;i<5;i++)
scanf("%d",a+i);
sort(a,a+5);
if(a[0]==a[1]&&a[1]==a[2]&&a[3]==a[4]&&a[0]!=a[4]||a[0]==a[1]&&a[1]!=a[2]&&a[2]==a[3]&&a[3]==a[4])
printf("Yes");
else
printf("No");
}
标签:them,Full,House,written,set,house,cards
From: https://www.cnblogs.com/mekoszc/p/16736104.html