#include <iostream>
#include <vector>
using namespace std;

typedef vector<double> Vec;

int main(){
  Vec a, b;
  double atmp;
  int i;
  
  while(1){
    cin >> atmp;
    if(cin.fail()){
      if(cin.eof())break;
      cerr << "Numeric format error\n.";
      return 1;
    }
    a.push_back(atmp);
  }
  
  cout << "I have read " << a.size() << " values..\n";
  
  for(i = 0; i < a.size(); i++){
    cout << "a[" << i << "] = " << a[i] << "\n";
  }
  if(a.size()>0){
    cout << "a.front()="<<a.front()<<endl
         << "a.back()="<<a.back()<<endl;
    a.pop_back();
    if(a.size()>0)
      cout << "eliminar ultimo a.back() = "<<a.back()<<endl;
  }
  if(a.size()>2)
    cout << "a.at(2)"<<a.at(2)<<endl;
  b = a;
  
  if(b == a){
    cout << "b and a are identical\n";
  }
  
  
  b.clear();
  cout << "after clearing b has size " << b.size() << "\n";
  system("pause");
  return 0;
}

