Created
May 6, 2020 01:39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
ios::sync_with_stdio(false), cin.tie(0); | |
int a, b; | |
cin >> a >> b; | |
int pos_a = a % 3; | |
int pos_b = b % 3; | |
if (pos_a == pos_b) pos_b = (pos_b % 3) // Não esquecer o resto nesta etapa. | |
// Para descobrir a cadeira de Carolina iremos somar o valor de todas cadeiras e subtrair das cadeiras já utilizadas. | |
int sum = 0 + 1 + 2; | |
sum -= a; // Cadeira de Ana utilzada | |
sum -= b; // Cadeira de Beatriz utilizada | |
cout << sum << "\n"; // A que sobrou é a de Carolina | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment