Advertisement
Guest User

danoman

a guest
May 25th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main(int argc, const char * argv[])
  6. {
  7.     double input;
  8.     int index = 0;
  9.     vector <double> v;
  10.    
  11.     cout << "Enter 10 integers: ";
  12.    
  13.     while (v.size() < 10)
  14.     {  
  15.         cin >> input;
  16.         v.push_back(input);
  17.     }  
  18.     cout << "you entered ";
  19.    
  20.     cout << v.size() << endl;
  21.     for (int j = 0; j < 10; j++)
  22.     {  
  23.         cout << v[j] << " ";
  24.     }  
  25.     cout << endl;
  26.    
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement