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