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