1.
program z1;
var S,t:integer;
V:real;
begin
write ('S = ');
readln (S);
write ('t = ');
readln (t);
V:=S/t;
writeln ('V = ',V)
end.
2.
program z2;
var a,b,c,P:integer;
write ('a = ');
readln (a);
write ('b = ');
readln (b);
write ('c = ');
readln (c);
P:=a + b + c;
writeln ('P = ',P)
3. 42
Объяснение:
1. Смотри картинки 1,2
2. Смотри картинки 3,4
3.
A = 10
А = 50 В = ? S = ?
B = A * 4 = 10 * 4 = 40
А = 10 В = 40 S = ?
A = A + B = 10 + 40 = 50
А = 50 В = 40 S = ?
B = B / 5 = 40 / 5 = 8
А = 50 В = 8 S = ?
S = A - B = 50 - 8 = 42
А = 50 В = 8 S = 42
pascalABC
Задание 1
var
arr: array of integer;
n, i, max1, max2: integer;
Write('Введите размер массива: ');
ReadLn(n);
SetLength(arr, n);
for i := 0 to n-1 do begin
arr[i] := random(100);
Write(' ', arr[i]);
end;
WriteLn;
max1 := arr[0];
max2 := arr[1];
if max1 < max2 then Swap(max1, max2);
for i := 2 to n-1 do begin
if arr[i] > max2 then max2 := arr[i];
WriteLn(max1+max2,', ',max1,', ', max2);
Задание 2
n, m, p, k, s: integer;
i, j: integer;
a: array[,] of integer;
Write('Введите размер массива n и m: ');
ReadLn(n, m);
SetLength(a, n, m);
for j := 0 to m-1 do begin
Write('a[',i,',',j,']=');
ReadLn(a[i,j]);
Write('Введите искомое число p= ');
ReadLn(p);
s:= -1;
if a[i,j] = p then
k:=k+1;
if s=-1 then s:=i;
if s>-1 then
Write(k,', ');
for j:=0 to m-1 do Write(a[s,j],', ')
end
else
Write('0');
1.
program z1;
var S,t:integer;
V:real;
begin
write ('S = ');
readln (S);
write ('t = ');
readln (t);
V:=S/t;
writeln ('V = ',V)
end.
2.
program z2;
var a,b,c,P:integer;
begin
write ('a = ');
readln (a);
write ('b = ');
readln (b);
write ('c = ');
readln (c);
P:=a + b + c;
writeln ('P = ',P)
end.
3. 42
Объяснение:
1. Смотри картинки 1,2
2. Смотри картинки 3,4
3.
A = 10
А = 50 В = ? S = ?
B = A * 4 = 10 * 4 = 40
А = 10 В = 40 S = ?
A = A + B = 10 + 40 = 50
А = 50 В = 40 S = ?
B = B / 5 = 40 / 5 = 8
А = 50 В = 8 S = ?
S = A - B = 50 - 8 = 42
А = 50 В = 8 S = 42
pascalABC
Объяснение:
Задание 1
var
arr: array of integer;
n, i, max1, max2: integer;
begin
Write('Введите размер массива: ');
ReadLn(n);
SetLength(arr, n);
for i := 0 to n-1 do begin
arr[i] := random(100);
Write(' ', arr[i]);
end;
WriteLn;
max1 := arr[0];
max2 := arr[1];
if max1 < max2 then Swap(max1, max2);
for i := 2 to n-1 do begin
if arr[i] > max2 then max2 := arr[i];
if max1 < max2 then Swap(max1, max2);
end;
WriteLn(max1+max2,', ',max1,', ', max2);
end.
Задание 2
var
n, m, p, k, s: integer;
i, j: integer;
a: array[,] of integer;
begin
Write('Введите размер массива n и m: ');
ReadLn(n, m);
SetLength(a, n, m);
for i := 0 to n-1 do begin
for j := 0 to m-1 do begin
Write('a[',i,',',j,']=');
ReadLn(a[i,j]);
end;
end;
Write('Введите искомое число p= ');
ReadLn(p);
s:= -1;
for i := 0 to n-1 do begin
for j := 0 to m-1 do begin
if a[i,j] = p then
begin
k:=k+1;
if s=-1 then s:=i;
end;
end;
end;
if s>-1 then
begin
Write(k,', ');
for j:=0 to m-1 do Write(a[s,j],', ')
end
else
Write('0');
end.