Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #AUTOR: FILIP DUJMUSIC
- #include <complex>
- #include <iostream>
- #include <math.h>
- using namespace std;
- typedef complex<double> dcmplx;
- int main() {
- dcmplx a,b,temp1,temp2,temp3;
- double x, y, z;
- cout<<"Ukucaj x: ";
- cin>>x;
- cout<<"\nUkucaj y: ";
- cin>>y;
- cout<<"\nUkucaj z: ";
- cin>>z;
- a = dcmplx(2,3);
- b = dcmplx(x,-y);
- temp1 = (pow(z,2))*a;
- temp2 = temp1 / b;
- temp3 = x + temp2;
- if(imag(temp3)>0){
- cout<<"Rjesenje je: "<<real(temp3)<<"+"<<imag(temp3)<<"i"<<endl;
- }
- else {
- cout<<"Rjesenje je: "<<real(temp3)<<imag(temp3)<<"i"<<endl;
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement