Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. class Tcomplex
  2. {
  3.  
  4. friend Tcomplex operator + (Tcomplex a, Tcomplex b);
  5. };
  6.  
  7. Tcomplex operator + (Tcomplex a, Tcomplex b)
  8. {
  9. Tcomplex c;
  10. c.Im=a.Im+b.Im;
  11. c.Re=a.Re+b.Re;
  12. return c;
  13. }
  14.  
  15. main()
  16. {
  17. Tcomplex L1(5,6);
  18. Tcomplex L2(3,2);
  19. Tcomplex L3();
  20.  
  21. L3=L1+L2;
  22. L3.drukuj();
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement