Jump to content

Programa pesquisa


Recommended Posts

Posted

Olá, o programa abaixo pesquisa nomes inseridos no teclado e dá os resultados ( a pesquisa é feita em string), e a pesquisa é feita somente com palavras exatas e inteiras,sem problemas. No entanto eu gostaria de saber se alguém sabe algum comando para ler somente as três primeiras iniciais e as três últimas letras de uma palavra digitada.

Alguém sabe exemplificar essa questão?

Obrigado

program video;
var
K: string; 
begin
Clrscr;

textbackground(white);
GotoXY (30,12);
textcolor (white);
writeLn ('Digite o seu nome');
Clrscr;

GotoXY (40,12);
readLn (K);
if K = 'Gervásio'
then
begin
Clrscr;

GotoXY (40,15);
textcolor (blue);
writeLn ('Nominho feio hein....');  
end 

else
if K = 'Patrícia'
then
begin
Clrscr;
GotoXY (40,10);
textcolor (red);
writeLn ('Cheia de malícia....');
writeLn;
end;
end.
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.