Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sp2014e4
//fpc 2.6.2 program HelloWorld; type Lista = ^Celda; Celda = record dato: integer; sig: Lista; end; procedure insertarOrdenado (elem: integer; var list: Lista); var actual, anterior, nuevo : Lista; begin if list=nil then begin new(list); list^.dato:=elem; list^.sig:=nil; end else begin actual:=list; anterior:=nil; while (actual<>nil) and (actual^.dato<=elem) do begin anterior:=actual; actual:=actual^.sig; end; new(nuevo); nuevo^.dato:=elem; nuevo^.sig:=actual; if anterior = nil then list:=nuevo else anterior^.sig:=nuevo; end; end; var list : lista; begin list:=nil; new(list); new(list^.sig); new(list^.sig^.sig); list^.dato:=1; list^.sig^.dato:=3; list^.sig^.sig^.dato:=6; insertarOrdenado(4,list); //writeln(list^.dato); writeln(list^.dato,',',list^.sig^.dato,',',list^.sig^.sig^.dato,',',list^.sig^.sig^.sig^.dato); end.
run
|
edit
|
history
|
help
0
Задача 2 урок не из учебника
practica 2 ejercicio 9
Funcion: numero perfecto
вариант 6, номер 1
the longest sub-array
Lab1SumWithFor
TAIRINE GOMES NEPOUMUCENO 600624521
Calculatrice 1.0
task 2
Object Pascal