Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
practica 7 ejercicio 4
program HelloWorld; {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- CONST - Define las constantes para usar en tiempo de compilacion} const caracteres = 800; {-----------------------------------------------------------------------------------------------------------------------} {-----------------------------------------------------------------------------------------------------------------------} {----------------------------------------------------------------- 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-------------//'); for i:= 1 to caracteres do read(v[i]); 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-------------//'); for i:= 1 to 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; 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
homework
abundante
test08
135
Opdracht_2
Matriz 9x9
Бассейн-8
AR sredine
Task 1
practica 2 ejercicio 8