Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- struct complex
- {
- double re;
- double im;
- }z;
- void citire(struct complex&z)
- {
- cin>>z.re>>z.im;
- }
- int modulr(struct complex z)
- {
- double m1=0;
- m1=m1+sqrt(z.re*z.re);
- return m1;
- }
- int moduli(struct complex z)
- {
- double m2=0;
- m2=m2+sqrt(z.im*z.im);
- return m2;
- }
- int main()
- {
- citire(z);
- cout<<modulr(z)<<"+"<<moduli(z)<<"*i"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement