Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test25
//fpc 3.0.4 {record with variable part "case"} program test25; type fig=(circle,quadra); Figure=record case f:fig of circle:(r:real); quadra:(a,b:real) {"a" gets the space of "r"} end; var m,q:Figure; function square(x:Figure):real; begin with x do case f of circle: square:=3.14*sqr(r); quadra:square:=a*b ; end; end; begin with m do begin f:=circle; r:=10; b:= 3; writeln(r:2:1); writeln(b:2:1); writeln(square(m):2:1) ; end; with q do begin f:=quadra; r:=2; {a:=1;}{"a" gets the space of "r"} b:= 3; writeln(r:2:1); writeln(b:2:1); writeln(square(q):2:1) ; end; end.
run
|
edit
|
history
|
help
0
Pascal First
считалочка03
test13
Lab1SumWithFor
nomer9
ariketa 09
practica 2 ejercicio 7
registro de alunos, calculo de média
1 2 9
Triangle.pas