diff --git a/cpfs.pas b/cpfs.pas index 553a269..f98348d 100644 --- a/cpfs.pas +++ b/cpfs.pas @@ -111,11 +111,13 @@ procedure inserirCPF(var cpfs:THash; var cpf:string); writeln('CPF INVALIDO'); end; -procedure escrever(var cpfs:thash); +procedure escreverCPF(var cpfs:thash); var i:integer; aux:^ptcpf; + achados:integer; begin + achados:=0; for i:= 0 to 99 do begin writeln('Digito final', i); @@ -123,9 +125,11 @@ procedure escrever(var cpfs:thash); while (aux <> nil) do begin writeln(aux^.cpf); - aux:= aux^.prox + aux:= aux^.prox; + achados:=achados+1; end; end; + writeln('Total de cpfs: ',achados) ; end; procedure buscar(var cpfs:thash;cpf:string); @@ -187,10 +191,11 @@ begin while not cont do begin - writeln('ADD cpf : 1'); - writeln('Validar existencia : 2'); - writeln('RM cpf : 3'); - writeln('exit : 0'); + writeln('ADD cpf: 1'); + writeln('Validar existencia: 2'); + writeln('RM cpf: 3'); + writeln('Listar cpfs: 4'); + writeln('exit: 0'); readln(op); case op of @@ -235,6 +240,11 @@ begin writeln('cpf invalido poxa'); end; + 4: + begin + escreverCPF(hash); + end; + 0 : begin cont:= true;