fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main() {
  5. std::vector<double> v;
  6. int a = 3;
  7. double b = 4.6;
  8.  
  9. v = {2, 1.3, a, b};
  10.  
  11. for (auto const& val : v)
  12. {
  13. std::cout << val << std::endl;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
2
1.3
3
4.6