Task: | Järjestys |
Sender: | xyrj |
Submission time: | 2022-01-22 13:09:36 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
Code
#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { string x; cin >> x; int At = 0; for (char c : x) if (c == 'A') At++; int tulos = 0; for (int j = 0; j < At; j++) if (x.at(j) == 'B') tulos++; cout << tulos; } }