• Lenguaje

    Pascal

  • Descripción

    Solicite ingresar la estatura de las personas, mientras estén en la fila, y finalizada la fila diga:
    a) ¿cuántas personas había?
    b) ¿cuántos excedieron los 150 centímetros?
    c) ¿cuántos medían igual o menos de 150 centímetros?

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
28
29
30
31
32
33
34
program EstaturaDePersonas;
uses crt;

var a, b, c, estatura : integer;
var tecla_repetir : char;
begin
    a := 0;
    b := 0;
    c := 0;
    repeat
        clrscr;
        write ('Ingresa el valor de estatura: ');
        readln (estatura);
        a := a+1;
        if estatura>150 then
            begin
                b := b+1;
            end
        else
            begin
                c := c+1;
            end;
        writeln;
        write (#168'Deseas repetir el proceso? (S/N): ');
        repeat
            tecla_repetir := readkey;
        until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
    until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
    writeln ('Valor de a: ', a);
    writeln ('Valor de b: ', b);
    writeln ('Valor de c: ', c);
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.