fork download
  1. #include <algorithm>
  2. #include <cstring>
  3. #include <iostream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int main() {
  8. const auto bar = 13U;
  9. const char multiplicand[] = "0, ";
  10. const auto length = strlen(multiplicand);
  11. const string foo(&*generate_n(string(bar * length, '\0').begin(), bar * length, [&]() {
  12. static auto i = 0U;
  13. return multiplicand[i++ % length];
  14. }) - bar * length);
  15.  
  16. cout << foo;
  17. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,