here's some c++ code.
vector<double> temps;
for (double temp; cin>>temp;)
temps.push_back(temp);
double sum = 0;
for (int x : temps) sum += x; //what is this doing?
cout << "Average temperature:
So the line:
for (int x : temps) sum += x;
What is it doing? Where is sum's value coming from?