Это управляющий символ.
Код 13 (шестнадцатеричное 0D) - этот символ вводится при нажатии клавиши перевода строки (Enter).
Если точнее, то этот символ называется "возврат каретки", или CR (сокр. от англ. CARRIAGE RETURN) -перемещает позицию ввода (или печати) к началу текущей строки.
В ОС Windows вместе с ним при нажатии Enter в файл запишется ещё один символ с кодом 10 (шестнадцатеричное 0A) - "перевод строки" или LF (сокр. от англ. LINE FEED) -перемещает позицию ввода (или печати) на одну строку вниз.
Только один символ CR используется для перевода строки в системах Macintosh (Mac OS).
Только один символ LF используется для перевода строки в Unix-системах.
Сам символ CR не видно на экране (правда, в Ворде и некоторых других текстовых редакторах можно всё же включить показ непечатаемых символов), но видно как происходит перевод строки при нажатии Enter.
1-е Задание:
Program PRG;
var
a, b, c, e, x, y, num, den: real;
function calc( a, b, c, e, x: real ): real;
begin
num := ((( abs(sin(x ** 3))) + a) * (e ** a));
den := (exp(ln((b ** 2) + (c ** 2)) / 3));
y := num / den;
Result := y;
write('Answer is: ', y);
writeln();
end;
function entNums (): real;
begin
write ('Enter a: '); readln (a);
write ('Enter b: '); readln (b);
write ('Enter c: '); readln (c);
write ('Enter e: '); readln (e);
write ('Enter x: '); readln (x);
writeln();
end;
begin
entNums();
calc( a, b, c, e, x );
end.
2-е Задание:
Program
var wallWid, wallHeight, winHeight, winWid, doorWid, doorHeight, fourWalls, door, win, total: real;
function getFourWalls( wallWid, wallHeight: real ): real;
begin
fourWalls := (wallHeight * wallWid) * 4;
Result := fourWalls;
end;
function getDoorSize( doorHeight, doorWid: real ): real;
begin
door := doorHeight * doorWid;
Result := door;
end;
function getWinSize( winHeight, winWid: real ): real;
begin
win := winHeight * winWid;
Result := win;
end;
function getWalls(): real;
begin
total := (fourWalls - ( door + win )) / 10000;
Result := total;
write(' You need ', total, ' m² of wallpaper!');
writeln();
end;
function enterSizes(): real;
begin
writeln();
write (' Enter width of the wall (in cm): '); readln (wallWid);
write (' Enter height of the wall (in cm): '); readln (wallHeight);
write (' Enter width of the window (in cm): '); readln (winWid);
write (' Enter hight of the window (in cm): '); readln (winHeight);
write (' Enter width of the door (in cm): '); readln (doorWid);
write (' Enter height of the doot (in cm): '); readln (doorHeight);
writeln();
end;
begin
enterSizes();
getFourWalls( wallWid, wallHeight );
getDoorSize( doorHeight, doorWid );
getWinSize( winHeight, winWid );
getWalls();
end.
Блок-схемы легко можешь составить глядя на коды программ)
Удачи)
Поделитесь своими знаниями, ответьте на вопрос:
program picaso; uses crt; type matrice=array[1..10,1..10] of integer; var i,j,n,m,k: integer; a: matrice; procedure rea(var a: matrice); begin writeln('n: '); readln(n); writeln('m: '); readln(m); writeln('ведите ',n*m,' элементов'); for i: =1 to m do for j: =1 to n do begin write('a[',i,',',j,']='); readln(a[i,j]); end; end; procedure writ; begin writeln('массив a'); for i: =1 to m do begin for j: =1 to n do write(a[i,j],' '); writeln; end; end; procedure calc(a: matrice ); begin for j: =1 to n do begin k: =0; for i: =1 to m do if a[i,j] > 0 then inc(k); writeln('столбец : ',j,' положительные элементы : ',k); end; end; begin clrscr; rea(a); writ; calc(a); readln; end.