|
|
1.1 ! root 1: program records(output); ! 2: type ! 3: cmplx = record ! 4: rp: real; ! 5: ip: real; ! 6: end; ! 7: var ! 8: x, y: cmplx; ! 9: function cadd(a,b: cmplx): cmplx; ! 10: var result: cmplx; ! 11: begin ! 12: result.rp := a.rp + b.rp; ! 13: result.ip := a.ip + b.ip; ! 14: cadd := result; ! 15: end; ! 16: procedure cprint(a: cmplx); ! 17: begin ! 18: writeln(a.rp, '+', a.ip, 'i'); ! 19: end; ! 20: begin ! 21: x.rp := 1; ! 22: x.ip := 2; ! 23: y.rp := 3; ! 24: y.ip := 4; ! 25: cprint(cadd(x, y)); ! 26: end.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.