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 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); end.
run
|
edit
|
history
|
help
0
4546
uuu
Сортировка массиа прямым выбором
Gertie
solar_system_yupiter
practica 3 ejercicio B5
practica 7 ejercicio 9
2
practica 1 ejercicio 6
JONES AKPOTU