fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. #define file "lcs"
  9.  
  10. inline void rf()
  11. {
  12. ios_base::sync_with_stdio(false);
  13. cin.tie(nullptr); cout.tie(nullptr);
  14. if(fopen(file".inp","r"))
  15. {
  16. freopen(file".inp","r",stdin);
  17. freopen(file".out","w",stdout);
  18. }
  19. }
  20.  
  21. string make_str(const string& pattern, int length) {
  22. if (length == 0) {
  23. return "";
  24. }
  25. string result = "";
  26. int pattern_len = pattern.length();
  27. for (int i = 0; i < length; ++i) {
  28. result += pattern[i % pattern_len];
  29. }
  30. return result;
  31. }
  32.  
  33. void solve() {
  34. int a, b, c;
  35. if (!(cin >> a >> b >> c)) {
  36. return;
  37. }
  38.  
  39. string X = make_str("1", a);
  40. string Y = make_str("0", b);
  41. string Z = make_str("10", c);
  42. string A = Y + Z;
  43. string B = Z + X;
  44. string C = X + Y;
  45. cout << A << endl;
  46. cout << B << endl;
  47. cout << C << endl;
  48. }
  49.  
  50. int main() {
  51. rf();
  52. solve();
  53. return 0;
  54. }
Success #stdin #stdout 0.01s 5312KB
stdin
7 7 8
stdout
000000010101010
101010101111111
11111110000000