#include <stdio.h>

struct complex{
  double real;
  double img;
 };

struct complex creat(void);
struct complex* minu(struct complex ,struct complex );
struct complex* power(struct complex ,struct complex );

int main()
{
 struct complex com1,com2,*resul;
 int i;
 
 //input
 com1 = creat();
 getchar();
 com2 = creat();
 getchar();
 
 do{
  printf(\"빼기 : 1, 곱하기 : 2\\t\");
  scanf(\"%d\",&i);
 }while(i!=1 && i!=2);

 //output
 if(i == 1)
  resul = minu(com1,com2);
 else
  resul = power(com1,com2);

 if(resul->img > 0)
  printf(\"%.2lf + %.2lfi\\n\",resul->real,resul->img);
 else if(resul->img < 0)
  printf(\"%.2lf %.2lfi\\n\",resul->real,resul->img);
 else
  printf(\"%.2lf\\n\",resul->real);

 return 0;
}

struct complex creat()
{
 struct complex creat;

 scanf(\"%lf %lf\",&creat.real,&creat.img);
 
 return creat;
}

struct complex* minu(struct complex t_com1,struct complex t_com2)
{
 static struct complex result;
 
 result.real = t_com1.real - t_com2.real;
 result.img = t_com1.img - t_com2.img;

 return &result;
}

struct complex* power(struct complex t_com1,struct complex t_com2)
{
 static struct complex result;
 
 result.real = t_com1.real * t_com2.real - t_com1.img * t_com2.img;
 result.img = t_com1.img * t_com2.real + t_com1.real * t_com2.img;

 return &result;
}

포인터로도 반환하고, 형도 반환하니 문제 없겠지 ? ㄱ-...

tag 안 쓴거 빼곤, 나름대로 깔끔하다고 자부 ``