Cod sursa(job #3197946)
| Utilizator | Data | 27 ianuarie 2024 18:32:52 | |
|---|---|---|---|
| Problema | Datorii | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.59 kb |
#include <iostream>
#include <string>
using namespace std;
void solve() {
bool ok = false;
for (int i = 1; i <= 3; ++i) {
char ch;
bool a = false, b = false, c = false, s = false;
for (int j = 1; j <= 3; ++j) {
cin >> ch;
if (ch == 'a')
a = true;
else if (ch == 'b')
b = true;
else if (ch == 'c')
c = true;
else s = true;
}
if (!ok && s) {
ok = true;
if (a && c)
cout << "B\n";
if (a && b)
cout << "C\n";
if (b && c)
cout << "A\n";
}
}
}
int main() {
int t;
cin >> t;
while (t--)
solve();
return 0;
}