program Project1; {$APPTYPE CONSOLE} uses SysUtils; type amici =record cognome:string; nome:string; citta:string; telefono:string; end; rubrica=array[1..50]of amici; var rub:rubrica; i,scelta:integer; cog:string; trovato:integer; begin repeat writeln('1- Inserimento dati '); writeln('2- Visualizzazione array '); writeln('3- Ricerca cognome '); writeln('4- Fine programma '); write('Fai la tua scelta '); readln(scelta); case scelta of 1: begin for i := 1 to 3 do begin write('cognome: '); readln(rub[i].cognome); write('nome: '); readln(rub[i].nome); write('cittą: '); readln(rub[i].citta); write('telefono: '); readln(rub[i].telefono); end; end; 2: begin for i := 1 to 3 do begin write(rub[i].cognome,' '); write(rub[i].nome,' '); write(rub[i].citta,' '); writeln(rub[i].telefono,' '); end; readln; end; 3:begin write(' inserire il cognome da ricercare '); readln(cog); trovato:=0; for I := 1 to 3 do begin if rub[i].cognome=cog then begin trovato:=1; write(rub[i].nome,' ',rub[i].citta,' ',rub[i].telefono); end; end; if trovato=0 then writeln('l''elemento non e'' in elenco'); readln; end; end; until scelta=4 ; end.