编辑代码

#include <stdio.h>
#include <string.h>
void m1(double x1,double y1,double x2,double y2)
{
    double n1=x1+x2;
    double n2=y1+y2;
printf("addition of complex is %lf+%lfi\n",n1,n2);
}
void m2(double x1,double y1,double x2,double y2)
{
    double n3=x1*x2-y1*y2;
    double n4=x1*y2+x2*y1;
    printf("product of complex is %lf+%lfi",n3,n4);
}
int main()
{
    double x1,y1,x2,y2;
    scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
    m1(x1,y1,x2,y2);
    m2(x1,y1,x2,y2);
    return 0;
}