This is comment for paste
Логические операции «и», «или», «не»
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string a, b, c, d;
- int a1{}, b1{}, c1{}, d1{};
- cin >> a >> a1 >> b >> b1 >> c >> c1 >> d >> d1;
- /*
- red 3 green 3 green 2 green -1
- 2 3
- red 2 green 1 red 3 red 3
- 3
- red 1 green 2 blue 3 yellow 3
- grey 5 grey 5 grey 5 grey 5
- 1 2 3
- red 3 green 3 green 2 ? -1
- 1 2 3
- */
- if (d == "?" && d1 == -1)
- {
- cout << 1 << endl
- << 2 << endl
- << 3 << endl;
- }
- else if (d != "?" && d1 != -1)
- {
- if (a == d && a1 == d1)
- {
- cout << 1 << endl;
- }
- if (b == d && b1 == d1)
- {
- cout << 2 << endl;
- }
- if (c == d && c1 == d1)
- {
- cout << 3 << endl;
- }
- }
- else if (d == "?" || d1 == -1)
- {
- if (a == d || a1 == d1)
- {
- cout << 1 << endl;
- }
- if (b == d || b1 == d1)
- {
- cout << 2 << endl;
- }
- if (c == d || c1 == d1)
- {
- cout << 3 << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment