Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test27
//fpc 3.0.4 {record with variable part "case"} program test27; type fig=(circle,quadra); Pfig=^Figure; Figure=record sled: Pfig; case f:fig of circle:(r:real); quadra:(a,b:real) {"a" gets the space of "r"} end; var m,q:Pfig; function square(x:Pfig):real; begin with x^ do case f of {"f" is an ordinal (!) record field of choice "case"} circle: square:=3.14*sqr(r); quadra:square:=a*b ; end; end; begin New(m); with m^ do begin sled:=Nil; f:=circle; r:=10; b:= 3; writeln(r:2:1); writeln(b:2:1); end; writeln(square(m):2:1) ; writeln; New(q); with q^ do begin sled:=m; f:=quadra; r:=2; {a:=1;}{"a" gets the space of "r"} b:= 3; writeln(r:2:1); writeln(b:2:1); end; writeln(square(q):2:1) ; writeln(square(q^.sled):2:1); Dispose(q); Dispose(m); end.
run
|
edit
|
history
|
help
0
pizza
0 1 0 0 0 1 1 1
practica 2 ejercicio 1
Tugas1
okazivac-dinamicka alokacija memorije
Greetings
Урок 3 задача 3
Linha d'água de uma caixa retangular
JESSICA GOMES DE SOUZA FERREIRA 600621634
practica 6 ejercicio 2