Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
practica 7 ejercicio 11
program HelloWorld; {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- CONST - Define las constantes para usar en tiempo de compilacion} const fin = 50; DimF = 7; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- TYPE - Define los tipos creados por el usuario para usar en tiempo de compilacion} type rangoNros = 1 .. DimF; Tvector = record vector : array [rangoNros] of real; end; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- VARIABLES GLOBALES - Define variables que se podran usar por todos los modulos de ser necesarias} //var {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- } procedure comparar(var v:Tvector; n: real); var i:rangoNros; begin i:=1; while(v.vector[i] > n)and(i < DimF)do i:= i+1; if n > v.vector[i] then v.vector[i]:= n; end; {----------------------------------------------------------------- } procedure leerNros(var v:Tvector); var n:real; begin randomize; n:=random(20)+(fin-10); while n <> fin do begin comparar(v,n); n:=random(20)+(fin-10); end; end; {----------------------------------------------------------------- } procedure inicializar(var v :Tvector); var i : rangoNros; begin for i := 1 to DimF do v.vector[i]:=0; end; {----------------------------------------------------------------- } procedure imprimir (v:Tvector); var i:rangoNros; begin for i := 1 to DimF do write('-----'); writeln; for i := 1 to DimF-1 do write('|',v.vector[i]:3:2); writeln('|',v.vector[DimF]:3:2,'|'); for i := 1 to DimF do write('-----'); writeln; end; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- PROGRAMA PRINCIPAL} var v:Tvector; begin inicializar(v); leerNros(v); imprimir(v); end. {-----------------------------------------------------------------------------------------------------------------------}
run
|
edit
|
history
|
help
0
practica 2 ejercicio 8
Task
test02
basketball_player_training
janja - popravek
Задача №3549. Замечательные числа - 5
AUMENTAR O DISMINUIR EDADES
SmallQuest
Angles
POBLAR Y MOSTRAR VECTOR EDADES