Advertisement
tei123

class

Apr 10th, 2018
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. class TComplex
  7. {
  8. public:
  9. float Re;
  10. float Im;
  11. TComplex::TComplex();
  12. TComplex::TComplex(float R);
  13. TComplex::TComplex(float R, float I);
  14. };
  15.  
  16. TComplex::TComplex()
  17. {
  18. Re=0;
  19. Im=0;
  20. };
  21.  
  22. TComplex::TComplex(float R)
  23. {
  24. Re=R;
  25. Im=0;
  26. };
  27. TComplex::TComplex(float R, float I)
  28. {
  29. Re=R;
  30. Im=I;
  31.  
  32. };
  33.  
  34.  
  35.  
  36. int main(int argc, char *argv[])
  37. {
  38. TComplex jeden(1,7);
  39. cout<<jeden.Re<<endl;
  40. cout<<jeden.Im<<endl;
  41. system("PAUSE");
  42. return EXIT_SUCCESS;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement