Program SumAndMul;
Uses Crt;
var a:array[1..10] of real;
i:integer;
sum,mul:longint;
begin
clrscr;
for i:=1 to 10 do
begin
write('Введите -', i,' число:' );
readln(a[i]);
end;
sum:=0;mul:=1;
for i:=1 to 10 do
begin
if (a[i]>0) then sum:=sum+a[i];
if (a[i]<0 ) then mul:=mul*a[i];
end;
writeln('Сумма положительных элементов: ',sum);
writeln('Произведение отрицательных элементов: ',mul);
readkey;
end.
Объяснение:
Язык не был указан, так что пишу на С++:
1)
#include <iostream>
using namespace std;
int main()
{
int buf, quantity = 0;
cin >> buf;
int sum = 0;
while (buf != 0) {
++quantity;
sum += buf;
cin >> buf;
}
cout << "Sum: " << sum << "\nAverage: " << sum / quantity;
}
2)
#include <iostream>
using namespace std;
int main()
{
int buf;
cin >> buf;
int max_num = buf;
while (buf != 0) {
if (max_num < buf) {
max_num = buf;
}
cin >> buf;
}
cout << "Max: " << max_num;
}
Ну если она была закодирована в ASCII то (Если в Unicode в 2 раза больше) :
То 1 символ = 1 Байт
1)1*8*40*30*20=192000 (бит)
2)192000/120=1600(бит/сек)
ответ 1600 бит/сек