Ayuda con punteros
Publicado por jorge (5 intervenciones) el 15/02/2016 09:21:03
alguien sabe hacer este ejercicio con punteros?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
program tope;
uses crt;
const max=5;
type
alum=record
tope:byte;
end;
procedure inicializa(var info:alum);
begin
info.tope:=0;
end;
function lleno (info:alum):boolean;
begin
lleno:=false;
if info.tope=max then begin
lleno:=true;
end;
end;
function vacio(info:alum):boolean;
begin
vacio:=false;
if info.tope=0 then begin
vacio:=true;
end;
end;
procedure entrada (var info:alum);
var
ok:boolean;
begin
clrscr;
ok:=lleno(info);
if ok=true then begin
write('Esta llena'); repeat until keypressed
end
else begin
write('Dato entrado'); repeat until keypressed;
inc(info.tope);
end;
end;
procedure listado(info:alum);
var
ok2:boolean;
begin
clrscr;
ok2:=vacio(info);
if ok2=true then begin
write('Esta vacio'); repeat until keypressed
end
else begin
write('Datos en la lista');repeat until keypressed;
inc(info.tope);
end;
end;
procedure menu;
begin
clrscr;
writeln('1.-Entrada :');
writeln('2.-Listado :');
writeln('3.-Fin :');
write('Dar opcion : ');
end;
var info:alum;
op:char;
begin
inicializa(info);
repeat
menu;
op:=readkey;
case op of
'1':entrada(info);
'2':listado(info);
end;
until op='3';
end.
Valora esta pregunta


0