Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
practica 7 ejercicio 5
program HelloWorld; {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- CONST - Define las constantes para usar en tiempo de compilacion} const caracteres = 800; fin = '.'; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- TYPE - Define los tipos creados por el usuario para usar en tiempo de compilacion} type rangoCaracteres = 1 .. caracteres; Tvector = array [rangoCaracteres] of char; conj = set of char; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- VARIABLES GLOBALES - Define variables que se podran usar por todos los modulos de ser necesarias} VAR i:rangoCaracteres; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- INICIALIZAR} procedure inicializacion(var voc:conj;var cons:conj;var min:conj;var may:conj;var dig:conj;var a:integer;var b:integer;var c:integer;var d:integer; var e:integer); begin writeln; writeln('//------------inicializar-------------//'); writeln; may:=['A'..'Z']; min:=['a'..'z']; voc:= ['a','e','i','o','u','A','E','I','O','U']; cons:=may+min; cons:= cons - voc; dig:=['1'..'9']; a:=0; b:=0; c:=0; d:=0; e:=0; end; {----------------------------------------------------------------- CARGAR} procedure cargarVector(var v:Tvector); begin writeln; writeln('//------------cargar-------------//'); i:= 1; read(v[i]); while (v[i] <> fin) and (i < caracteres) do begin i := i + 1; read(v[i]); end; writeln; end; {----------------------------------------------------------------- RECORRER} procedure recorrerVector(v:Tvector;voc,cons,min,may,dig:conj;var cvoc:integer;var ccons:integer;var cmin:integer; var cmay:integer;var cdig:integer); begin writeln; writeln('//------------recorrer-------------//'); i:=1; while (v[i] <> fin) and (i <= caracteres) do begin if v[i] in voc then begin cvoc:= cvoc+1; end else if v[i] in cons then ccons := ccons + 1; if v[i] in min then begin cmin:= cmin + 1; end else if v[i] in may then begin cmay :=cmay + 1; end else if v[i] in dig then cdig:= cdig + 1; i:= i + 1; end; writeln; end; {----------------------------------------------------------------- IMPRIMIR} procedure imprimir(voc,cons,min,may,dig:integer); begin writeln('//------------imprmir-------------//'); writeln; writeln('cantidad de vocales: ',voc); writeln; writeln('cantidad de consonantes: ',cons); writeln; writeln('cantidad de mayusculas: ',may); writeln; writeln('cantidad de minusculas: ',min); writeln; writeln('cantidad de digitos: ',dig); end; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- PROGRAMA PRINCIPAL} var v:Tvector; car : char; voc,cons,min,may,dig:conj; cvoc,ccons,cmin,cmay,cdig:integer; begin inicializacion(voc,cons,min,may,dig,cvoc,ccons,cmin,cmay,cdig); cargarVector(v); recorrerVector(v,voc,cons,min,may,dig,cvoc,ccons,cmin,cmay,cdig); imprimir(cvoc,ccons,cmin,cmay,cdig); end. {-----------------------------------------------------------------------------------------------------------------------}
run
|
edit
|
history
|
help
0
08 Ariketa
1 25 5
fff
practica 6 ejercicio 2
Huong11a2@
LUIZ ANTONIO RANGEL MUNIZ 60061122
Opdracht_1
Zad 3 a
solar_system_array_n_planets
Complemento da VS ICC II - 1º Semestre 2017