Advertisement
sellmmaahh

ZSR10-zad2

May 17th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Vektor3d
  6. {
  7.     double koordinate [3];
  8. public:
  9.     Vektor3d (double x, double y, double z) { Vektor3d::koordinate[0]=x; Vektor3d::koordinate[1]=y; Vektor3d::koordinate[2]=z;};
  10.     Vektor3d () {for (int i=0; i<3; i++) Vektor3d::koordinate[i]=0; };
  11.     void Ispisi () const
  12.     {
  13.         std::cout<<"{"<<koordinate[0]<<","<<koordinate[1]<<","<<koordinate[2]<<"}";
  14.     }
  15. };
  16. int main ()
  17. {
  18.     Vektor3d v1(3,4,5), v2;
  19.  
  20.     v1.Ispisi ();
  21.     v2.Ispisi();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement