Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #AUTOR: FILIP DUJMUSIC
  2. #include <complex>
  3. #include <iostream>
  4. #include <math.h>
  5. using namespace std;
  6.  
  7. typedef complex<double> dcmplx;
  8.  
  9. int main() {
  10.     dcmplx a,b,temp1,temp2,temp3;
  11.     double x, y, z;
  12.     cout<<"Ukucaj x: ";
  13.     cin>>x;
  14.     cout<<"\nUkucaj y: ";
  15.     cin>>y;
  16.     cout<<"\nUkucaj z: ";
  17.     cin>>z;
  18.     a = dcmplx(2,3);
  19.     b = dcmplx(x,-y);
  20.     temp1 = (pow(z,2))*a;
  21.     temp2 = temp1 / b;
  22.     temp3 = x + temp2;
  23.     if(imag(temp3)>0){
  24.                       cout<<"Rjesenje je: "<<real(temp3)<<"+"<<imag(temp3)<<"i"<<endl;
  25.                       }
  26.     else {
  27.          cout<<"Rjesenje je: "<<real(temp3)<<imag(temp3)<<"i"<<endl;
  28.          }                  
  29.     system("PAUSE");
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement