fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int l1, l2;
  6. cin >> l1 >> l2;
  7. srand(time(nullptr));
  8. while (l1--)
  9. {
  10. cout << char('A' + rand() % 2);
  11. }
  12. cout << endl;
  13. while (l2--)
  14. {
  15. cout << char('A' + rand() % 2);
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5332KB
stdin
5 7
stdout
ABABA
BBBBBAA