fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main() {
  5. std::vector<int> a = { 3 };
  6. a.assign(10, a.front());
  7.  
  8. for (const auto &item : a) {
  9. std::cout << item << std::endl;
  10. }
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 4352KB
stdin
Standard input is empty
stdout
3
3
3
3
3
3
3
3
3
3