| Код | program akt; uses crt; {Модуль, используемый для очистки экрана процедурой clrscr;} var names: array[1..6] of string; number:array[1..6] of integer; cost: array[1..6] of real; i: integer; amount, all_: real; begin all_ := 0; for i := 1 to 6 do {Ввод данных} begin writeln(i, ': name: '); readln(names[i]); writeln('number: '); readln(number[i]); writeln('cost: '); readln(cost[i]); end; clrscr;{Очищаем экран} writeln('N | name | number | cost | amount');{Шапка таблицы} for i := 1 to 6 do begin amount := number[i]*cost[i]; {Стоимость} writeln(i, ' | ', names[i], ' | ', number[i], ' | ', cost[i]:5:2, ' | ', amount:5:2);{Выводим строку таблицы} all_ := all_ + amount; {Сумма} end; writeln('All: ', all_:5:2); {Вывод суммы} readln; end.
|
|