1)
const n = 4; m = 4;
var A:array[1..n, 1..m] of integer;
i, j, iMax, jMax:integer;
begin
write('Заполнение - Матрица:');
for i:=1 to n do begin
for j:=1 to m do begin
read(a[i, j])
end;
end;
write('Матрица:');
for i:=1 to n do begin
writeln;
for j:=1 to m do begin
write(a[i, j]:3, ' ');
end;
end;
iMax:=1;
jMax:=1;
for i:=1 to n do
for j:=2 to n do begin
if a[i, j] > a[iMax, jMax] then begin
iMax:=i;
jMax:=j;
end;
end;
writeln;
writeln('Максимальный элемент: A[', iMax, ', ', jMax, ']=', a[iMax, jMax]);
end.
Вторую не успел сделать, надо уехать.
Объяснение:
/** libraries */
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
/** libraries */
using namespace std;
/** defines */
#define ll long long
#define ld long double
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"
/** defines */
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ld a;
cin >> a;
if(a > 0)
a += 20;
cout << a;
}
//1)
var x, y: integer;
begin
write('Введите x y: ');
read(x, y);
if x > y then
writeln(x - y)
else
writeln(y - x);
end.
//2)
var a, b, c: integer;
begin
write('Введите a b c: ');
read(a, b, c);
if (a > (b + c)) then
writeln(a)
else
writeln(b + c);
end.
//3)
var x, k: integer;
begin
write('Введите x k: ');
read(x, k);
if k = 1 then
writeln(sin(x))
else
if k = 2 then
writeln(cos(x))
else
writeln('k должен быть равен 1 или 2.');
end.
//4)
var p, m: integer;
begin
write('Введите p, m: ');
read(p, m);
if p > m * 2 then
writeln(p)
else
writeln(m * 2);
end.