#include "Complex.h"

void Print2Complex(Complex z1,Complex z2);

int main(){
  double A,B,C;
  Complex z1,z2;
  
  printf("A=");scanf("%lf",&A);
  printf("B=");scanf("%lf",&B);
  printf("C=");scanf("%lf",&C);
  
  solve(A,B,C,&z1,&z2);
  printf("(1) Solution of A*Z^2+B*Z+C=0\n");
  printf("    with A=%g, B=%g, C=%g\n",A,B,C);
  printf("    ->");
  Print2Complex(z1,z2);
  printf("\n");
  
  printf("(2) z1 <-> z2\n");
  PermutComplex(&z1,&z2);
  Print2Complex(z1,z2);
  printf("\n");
  printf("(3) z1 <- z1+z2\n");
  z1=axpbyComplex(1.0,z1,1.0,z2);
  Print2Complex(z1,z2);
  printf("\n");
}

void Print2Complex(Complex z1,Complex z2){
  printf("  z1=");PrintComplex(z1);
  printf(", z2=");PrintComplex(z2);
}