The instructions for this problem are:
" Write a complete program that reads in 100 double values from standard input (keyboard) into a vector. Then output all 100 values to standard output (terminal) in the same order they were read in with one space between each value."
I do not need to worry about prompting the user with instructions.
The code I have so far is:
#include
#include
int main()
{
vector values(99);
while( int i = 0 ; i <= 99 ; i++ )
{
cin << vector[i];
}
for ( int i = 1 ; i < values.size()-1 ; i++ )
{
cout << vector[i] << " " ;
}
return 0;
}
Could someone please tell me what I am doing wrong? Thanks in advance.
2007-03-17
17:45:32
·
2 answers
·
asked by
fortune_snookies
2
in
Computers & Internet
➔ Programming & Design