It is a code that gets some double
s from the user input, and then prints them.
Input looks like this 1 2 3 4.5 x
, where x
is an arbitrary non-double
to break the first for
loop.
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<double> *b;
for (double i; cin >> i;)
{
b->push_back(i);
}
for (double j:(*b))
{
cout << j << endl;
}
return 0;
}
1