suppose you will get the average of N numbers.
the input would just be the N numbers
e.g.
1 2 3 4
2.5
1 2 3 4 5
3
my problem is how to terminate when the enter is pressed.
Code:while ( \* right code *\ != '\n' ) { cin >> x; ave+=x; n++; } cout<< ave/n;



LinkBack URL
About LinkBacks


