Advertisement
sellmmaahh

ZSR10-zad1

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