• Lenguaje

    Pascal

  • Descripción

    Ingrese una serie de N números y calcule la cantidad de números positivos que ingreso.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
program CantidadDePositivos;
uses crt;

var i, n, positivos : integer;
var un_numero : real;
begin
    positivos := 0;
    write ('Ingresa el valor de n: ');
    readln (n);
    for i:=1 to n do
    begin
        writeln ('PROCESO ', i);
        write ('Ingresa el valor de un numero: ');
        readln (un_numero);
        if un_numero>0 then
            begin
                positivos := positivos+1;
            end;
        writeln;
    end;
    writeln ('Valor de positivos: ', positivos);
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.