Advertisement
Alex_Fuleki21

h

Mar 14th, 2020
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. struct complex
  5. {
  6. double re;
  7. double im;
  8. }z;
  9. void citire(struct complex&z)
  10. {
  11. cin>>z.re>>z.im;
  12. }
  13. int modulr(struct complex z)
  14. {
  15. double m1=0;
  16. m1=m1+sqrt(z.re*z.re);
  17. return m1;
  18. }
  19. int moduli(struct complex z)
  20. {
  21. double m2=0;
  22. m2=m2+sqrt(z.im*z.im);
  23. return m2;
  24. }
  25. int main()
  26. {
  27. citire(z);
  28. cout<<modulr(z)<<"+"<<moduli(z)<<"*i"<<endl;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement