Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int a, b, c;
- std::cin >> a >> b >> c;
- const unsigned int numberOfValues = 3;
- const unsigned int rows = 1 << numberOfValues;
- const unsigned int cols = numberOfValues;
- bool sumUp = false;
- int tripleCombs[rows][cols] = {1, 1, 1,
- 1, -1, 1,
- 1, 1, -1,
- 1, -1, -1,
- -1, 1, 1,
- -1, -1, 1,
- -1, 1, -1,
- -1, -1, -1};
- for (unsigned int i = 0; i < rows; i++)
- for (unsigned int j = 0; j < cols; j++)
- if (a * tripleCombs[i][j] + b * tripleCombs[i][j + 1] + c * tripleCombs[i][j + 2] == 13)
- sumUp = true;
- std::cout << ((sumUp) ? "Yes" : "No") << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement