{Elaborar un programa en pascal que use la sentencia "FOR"}
{para introducir 10 numeros continuos y sume los positivos}
{con positivos y negativos con negativos. luego usar la sentencia}
{"CASE" para seleccionar 1 de las operaciones algebraicas}
{(Suma, Resta, Multiplicación o División), y mostrar por pantalla}
{la suma y resultado de los numeros positivos y la suma}
{y resultado de los numeros negativos}
program ejercicio_2;
uses wincrt;
var
positivos:integer;
negativos:integer;
a,b,c,d:integer;
i,num:integer;
s:real;
opc,n1,n2:integer;
begin
clrscr;
positivos:=0;
negativos:=0;
for i:=1 to 10 do begin
write('Ingrese un numero entero: ');
readln(num);
if num >= 0 then
positivos:=positivos + num;
negativos:=negativos + num;
end;
writeln('La suma de los positivos es: ',positivos);
writeln('La suma de los negativos es: ',negativos);
begin
writeln('Que operacion desea realizar');
write('1=suma, 2=resta, 3=multiplicacion, 4=division: ');
readln(opc);
positivos:= a + b;
negativos:= c + d;
case opc of
1:
begin
s:= a + b;
writeln('La suma de los numeros positivos es : ',s:4:4);
s:= c + d;
writeln('La suma de los numeros negativos es : ',s:4:4);
end;
end;
end;
end.