#include typedef struct komplex { int real; int imag; } komplex; komplex add(komplex k1, komplex k2) { komplex e; e.real = k1.real+k2.real; e.imag = k1.imag+k2.imag; return e; } komplex mul(komplex k1, komplex k2) { komplex e; e.real = k1.real*k2.real-k1.imag*k2.imag; e.imag = k1.imag*k2.real+k1.real*k2.imag; return e; } void printk(komplex k) { printf("(%d%+di)\n", k.real, k.imag); } int main() { komplex x1,x2,e; x1.real = 10; x1.imag = 2; x2.real = 20; x2.imag = -3; printk(x1); printk(x2); e = add(x1,x2); printk(e); printk(mul(x1,x2)); return 0; }