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; a:=1; b:= 3; writeln(r:2:1); writeln(b:2:1); writeln(square(q):2:1) ; end; end.
run
|
edit
|
history
|
help
0
Луноход-4
LISTNAME
Tugas
Solving Quadratic Equation
Main-main
the longest sub-array
ANDRESSA LIMA NEPOMUCENO 600624624
real vs integer
zadanye 2
zad27-notoptimized