/*
本题要求编写程序,计算2个复数的和、差、积、商。
输入格式:
输入在一行中按照a1 b1 a2 b2的格式给出2个复数C1=a1+b1i和C2=a2+b2i的实部和虚部。题目保证C2不为0。
输出格式:
分别在4行中按照(a1+b1i) 运算符 (a2+b2i) = 结果的格式顺序输出2个复数的和、差、积、商,数字精确到
小数点后1位。如果结果的实部或者虚部为0,则不输出。如果结果为0,则输出0.0。
输入样例1:
2 3.08 -2.04 5.06
输出样例1:
(2.0+3.1i) + (-2.0+5.1i) = 8.1i
(2.0+3.1i) - (-2.0+5.1i) = 4.0-2.0i
(2.0+3.1i) * (-2.0+5.1i) = -19.7+3.8i
(2.0+3.1i) / (-2.0+5.1i) = 0.4-0.6i
输入样例2:
1 1 -1 -1.01
输出样例2:
(1.0+1.0i) + (-1.0-1.0i) = 0.0
(1.0+1.0i) - (-1.0-1.0i) = 2.0+2.0i
(1.0+1.0i) * (-1.0-1.0i) = -2.0i
(1.0+1.0i) / (-1.0-1.0i) = -1.0
*/
#include<stdio.h>
int main()
{
double a1,b1,a2,b2;
scanf("%lf%lf%lf%lf",&a1,&b1,&a2,&b2);
//问题都在于输出格式
if(b1>0&&b2<0){//这一处是判断输入题目是的格式,如果虚部小于零前方就不应有符号
//加法运算
if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
//强制类型转换是为了比较式子取一位小数的结果,如果结果保留小数点后一位后为0,则比较及输出时也视为0
else if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1+a2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
else if(((int)((b1+b2)*10)<0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else printf("(%.1lf+%.1lfi) + (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
//减法运算
if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1-a2);
else if((int)(10*(b1-b2))>0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
else if((int)((b1-b2)*10)>0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else if((int)((b1-b2)*10)<0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else printf("(%.1lf+%.1lfi) - (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
//乘法运算
if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1*a2-b1*b2);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))<0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else printf("(%.1lf+%.1lfi) * (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
//除法运算
if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))==0)
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))<0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else
printf("(%.1lf+%.1lfi) / (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));}
//接下来的都与上一段相似
else if(b1<0&&b2>0){
if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1+a2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
else if(((int)((b1+b2)*10)<0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else printf("(%.1lf%.1lfi) + (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1-a2);
else if((int)(10*(b1-b2))>0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
else if((int)((b1-b2)*10)>0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else if((int)((b1-b2)*10)<0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else printf("(%.1lf%.1lfi) - (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1*a2-b1*b2);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))<0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else printf("(%.1lf%.1lfi) * (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))==0)
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))<0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else
printf("(%.1lf%.1lfi) / (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));}
else if(b1<0&&b2<0){
if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1+a2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
else if(((int)((b1+b2)*10)<0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else printf("(%.1lf%.1lfi) + (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1-a2);
else if((int)(10*(b1-b2))>0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
else if((int)((b1-b2)*10)>0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else if((int)((b1-b2)*10)<0&&(int)(10*(a1-a2))==0)
printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else printf("(%.1lf%.1lfi) - (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1*a2-b1*b2);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))<0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else printf("(%.1lf%.1lfi) * (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))==0)
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = %.1lf\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))<0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else
printf("(%.1lf%.1lfi) / (%.1lf%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));}
else {
if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(b1+b2))==0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1+a2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else if(((int)((b1+b2)*10)>0)&&((int)(10*(a1+a2))!=0))
printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
else if(((int)((b1+b2)*10)<0)&&((int)(10*(a1+a2))==0))
printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1+b2);
else printf("(%.1lf+%.1lfi) + (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1+a2,b1+b2);
if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(b1-b2))==0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1-a2);
else if((int)(10*(b1-b2))>0&&(int)(10*(a1-a2))!=0)
printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
else if((int)((b1-b2)*10)>0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else if((int)((b1-b2)*10)<0&&(int)(10*(a1-a2))==0)
printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,b1-b2);
else printf("(%.1lf+%.1lfi) - (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1-a2,b1-b2);
if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if((int)(10*(a1*b2+a2*b1))==0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,a1*a2-b1*b2);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))>0&&(int)(10*(a1*a2-b1*b2))!=0)
printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
else if((int)(10*(a1*b2+a2*b1))<0&&(int)(10*(a1*a2-b1*b2))==0)
printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,a1*b2+a2*b1);
else printf("(%.1lf+%.1lfi) * (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,a1*a2-b1*b2,a1*b2+a2*b1);
if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))==0)
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = 0.0\n",a1,b1,a2,b2);
else if(((int)(10*(-a1*b2+a2*b1))==0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = %.1lf\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&((int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2))))!=0)
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = %.1lf+%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))>0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else if(((int)(10*(-a1*b2+a2*b1))<0)&&(int)(10*((a1*a2+b1*b2)/(a2*a2+b2*b2)))==0)
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = %.1lfi\n",a1,b1,a2,b2,(-a1*b2+a2*b1)/(a2*a2+b2*b2));
else
printf("(%.1lf+%.1lfi) / (%.1lf+%.1lfi) = %.1lf%.1lfi\n",a1,b1,a2,b2,(a1*a2+b1*b2)/(a2*a2+b2*b2),(-a1*b2+a2*b1)/(a2*a2+b2*b2));}
return 0;
}