var x: array [1..100] of real; sumP, sumN, max: real; i, num, count: integer; begin sumP := 0; sumN := 0; num := 1; repeat write('Enter number: '); readln(x[num]); if x[num] > 0 then sumP := sumP + x[num] else sumN := sumN + abs(x[num]); inc(num); until (num > 100) or (sumP > sumN); writeln; count := 0; max := abs(x[1]); writeln('All numbers: '); for i := 1 to num - 1 do begin if trunc(x[i]) mod 2 = 0 then inc(count); if abs(x[i]) > max then max := abs(x[i]); write(x[i]:6:2, ' '); end; writeln; writeln('Even numbers count: ', count); writeln('Max absolute value: ', max:6:2); readln; end. |