#include
#include
#include
#include
#include
#include
#include
using namespace std;
template
void print(T& c){
for( typename T::iterator i = c.begin(); i != c.end(); i++ ){
std::cout << *i << endl;
}
}
int main(){
const float a[] = { 1, 1.3, 1.5, 0.9, 0.1, 0.2};
vector data( a,a + sizeof( a ) / sizeof( a[0] ) );
cout << data.size() << " ELEMENTS\n";
print( data );
// compute the mean
float mean = accumulate( data.begin(), data.end(), 0.0f )/ data.size();
// subtract the mean from every data point
vector zero_mean( data );
transform( zero_mean.begin(), zero_mean.end(), zero_mean.begin(),bind2nd( minus(), mean ) );
print( zero_mean );
}