-
Notifications
You must be signed in to change notification settings - Fork 1
/
A.cpp
40 lines (30 loc) · 804 Bytes
/
A.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 ara[8];
int main()
{
for(int i = 1; i <= 6; i++) {
scanf("%d", &ara[i]);
}
int sum = 0;
for(int i = 1; i <= 6; i++) {
for(int j = 1; j <= 6; j++) {
for(int k = 1; k <= 6; k++) {
if(i != k && k != j && j != i) {
sum = ara[i] + ara[j] + ara[k];
int tmp = 0;
for(int l = 1; l <= 6; l++) {
if(l != i && l != j && l != k)
tmp += ara[l];
}
if(sum == tmp) {
printf("YES\n");
return 0;
}
}
}
}
}
printf("NO\n");
return 0;
}