Update cpfs.pas
This commit is contained in:
@@ -6,7 +6,7 @@ type
|
||||
cpf : string;
|
||||
prox : TCPF;
|
||||
end;
|
||||
THash = array[0..99] of ptcpf;
|
||||
THash = array[0..99] of ^ptcpf;
|
||||
|
||||
var
|
||||
cpf:string;
|
||||
@@ -21,10 +21,10 @@ var tmp:integer;
|
||||
charInt:=tmp; //ord('0')=48... ord('1')=49... dai -48 vira 0...
|
||||
end;
|
||||
|
||||
function validacaoDeInexistencialismoDeOutroCadastroDePessoasFisicasDentroDaLista(var cpf:string; final:integer; cpfs:thash ): boolean;
|
||||
function validacaoDeInexistencialismoDeOutroCadastroDePessoasFisicaDentroDaLista( var cpf:string; final:integer; var cpfs:thash ): boolean;
|
||||
var
|
||||
i:integer;
|
||||
aux:tcpf;
|
||||
aux:^ptcpf;
|
||||
existenciaDeTalInformacaoNaLista:boolean;
|
||||
begin
|
||||
aux := cpfs[final];
|
||||
@@ -76,7 +76,6 @@ procedure inserirCPF(var cpfs:THash; var cpf:string);
|
||||
doisDigitos:=( charInt(cpf[10])*10 ) + charInt(cpf[11]); //*10 pq né, vira dezena + decimal 👍
|
||||
if (validacaoDeInexistencialismoDeOutroCadastroDePessoasFisicasDentroDaLista(cpf, doisDigitos, cpfs)) then
|
||||
begin
|
||||
|
||||
new(novo);
|
||||
if novo = nil then
|
||||
writeln('Memoria cheia')
|
||||
@@ -107,6 +106,11 @@ procedure inserirCPF(var cpfs:THash; var cpf:string);
|
||||
writeln('CPF INVALIDO');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
begin
|
||||
readln(cpf);
|
||||
inserirCPF(hash,cpf);
|
||||
|
||||
Reference in New Issue
Block a user