#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main () { double Input_number; cout << "Enter a non-number e to stop entering numbers.\n"; cout << "Enter number : "; while(cin >> Input_number) { cout << "Enter number [float or 'e' to end.]: "; Input_number } return 0; }

Ok, this is what i have right now. What I want to know to how to get is the "x" amount of numbers from the user input.

For example. If the user inputs 1, 2, 3, and 4 from the loop, and the output average is 10/4. I want to figure out how to get all the variables into one number. like x1,x2,x3,and x4 into one number or individually so i can make a statement to calculate with. Then I would also please like to know how to get the number of inputs into a variable. Like since there are 4 inputs how would like get 4 inputs to use as a variable?

PS. The user can input as many numbers as he/she wants, i just want to know how to get those numbers with a loop. thanks very much.

This post has been edited by **nevereap**: 27 January 2010 - 08:45 PM