#include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
class Point
{
friend ostream &operator<<( ostream &, const Point & );
public:
Point( double=0, double=0, double=0 );
void setPoint( double, double, double );
double getX() const { return x; }
double getY() const { return y; }
double getZ() const { return z; }
protected:
double x,y,z;
};
Point::Point( double a, double b, double c ) { setPoint( a, b, c ); }
void Point:

etPoint( double a, double b, double c )
{
x=a;
y=b;
z=c;
}
ostream &operator<<( ostream &output, const Point &p )
{
output << setiosflags( ios::fixed | ios:

howpoint )
<< setprecision(2)
<< '[' << p.x << "," << p.y << "," << p.z << "]";
return output;
}
int main()
{
int SIZE=10;
Point p[10];
srand( time(NULL) );
for ( int i=0; i<SIZE; i++ )
p[i].setPoint( (rand()%100 ) / float(100), rand()%100/float(100), 0.03 );
for ( int i=0; i<SIZE; i++ ) {
cout << p[i] << endl;
}
system( "pause" );
return 0;
}