Добавил:
student_tipo
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:лабораторная работа / 1-1 X-mas сумма и кол полож и отр / X-mas
.txt program Xmas;
var
x: array[1..6] of integer;
i,sum,col:integer;
begin
WriteLn('Vvedite massiv');
for i:=1 to 6 do
Read(x[i]);
WriteLn(' Col-vo Summa');
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]>0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' + ',col,' ',sum);
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]<0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' - ',col,' ',sum);
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]=0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' 0 ',col,' ',sum);
ReadLn(i);
end.
var
x: array[1..6] of integer;
i,sum,col:integer;
begin
WriteLn('Vvedite massiv');
for i:=1 to 6 do
Read(x[i]);
WriteLn(' Col-vo Summa');
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]>0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' + ',col,' ',sum);
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]<0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' - ',col,' ',sum);
sum:=0;
col:=0;
for i:=1 to 6 do
if x[i]=0 then
begin
sum:=sum+x[i];
col:=col+1;
end;
WriteLn(' 0 ',col,' ',sum);
ReadLn(i);
end.
Соседние файлы в папке 1-1 X-mas сумма и кол полож и отр