Lee nombres de personas y dice cuantos caracteres tiene cada nombre
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | {-Victor De la Rocha} {-Algoritmia@groups.msn.com} {-www.myalgorithm.com} uses crt;type vector=array [1..100] of string; var arreglo:vector; cont1,cantidad,letras:integer;begin ClrScr; Write('Cantidad de nombres: ');Readln(cantidad); for cont1:=1 to cantidad do begin Write('Nombre ',cont1,': ');Readln(arreglo[cont1]); end; Writeln; for cont1:=1 to cantidad do begin letras:=length(arreglo[cont1]); writeln(arreglo[cont1],': ',letras,' letras.'); end; ReadKey; end. |
Cantidad: 5
Nombre 1: Guadalupe
Nombre 2: Laura
Nombre 3: Rorro
Nombre 4: Chet irruris
Nombre 5: Show Show
Guadalupe: 9
Laura: 5
Rorro: 5
Chet irruris: 12
Show Show: 9