Вова12345678912
16.07.2022 00:23

Паскаль объясните как работает программа подробно Program kursayin_khndir_2;
Type arr = array [1..100] of integer;
var
s1, s2, s3: string;
n1, n2, n3, l1, l2, l3, i: byte;
c: string[1];
begin
writeln(' 1 ');
readln(s1);
writeln(' 2 ');
readln(s2);
l1 := length(s1);
l2 := length(s2);
if l1 > l2 then begin
s3 := s1; l3 := l1;
s1 := s2; l1 := l2;
s2 := s3; l2 := l3;
end;
s3 := ''; n3 := 0;
for i := l1 downto 1 do begin
val(s1[i], n1);
val(s2[l2], n2);
l2 := l2 - 1;
str((n1 + n2 + n3) mod 10, c);
s3 := c + s3;
if n1 + n2 + n3 > 9 then
n3 := 1
else n3 := 0;
end;
while n3 = 1 do begin
if l2 <> 0 then begin
val(s2[l2], n2);
l2 := l2 - 1;
str((n2 + n3) mod 10, c);
s3 := c + s3;
if n2 + n3 < 10 then
n3 := 0;
end
else begin
s3 := '1' + s3;
n3 := 0;
end;
end;
if l2 <> 0 then
s3 := copy(s2, 1, l2) + s3;
writeln('1 + 2 ');
writeln(s3);
end.

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
Donisimys000000
21.06.2020 09:09
// PascalABC.NET 3.1, сборка 1219 от 16.04.2016
begin
  Range(-50,50,5).Tabulate(x->(x+4)*sqr(x+4)-sin(x)).Print(NewLine)
end.

Результат:
(-50,-97336.2623748537)
(-45,-68920.1490964755)
(-40,-46655.2548868395)
(-35,-29791.4281826695)
(-30,-17576.9880316241)
(-25,-9261.1323517501)
(-20,-4095.08705474927)
(-15,-1330.34971215984)
(-10,-216.544021110889)
(-5,-1.95892427466314)
(0,64)
(5,729.958924274663)
(10,2744.54402111089)
(15,6858.34971215984)
(20,13823.0870547493)
(25,24389.1323517501)
(30,39304.9880316241)
(35,59319.4281826695)
(40,85183.2548868395)
(45,117648.149096475)
(50,157464.262374854)
0,0(0 оценок)
Ответ:
пандос3
15.06.2021 13:15
#include <iostream>
#include <iomanip>
int main()
{
    using namespace std;
    const int N = 4;
    const int M = 4;
    int Y[N][M];

    //как-нибудь заполняем матрицу
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < M; ++j)
            Y[i][j] = (i + 1) * (j + 1);

    //выведем её на экран
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < M; ++j)
            cout << setw(3) << Y[i][j];
        cout << endl;
    }
        
    //находим сумму элементов побочной диагонали
    int S = 0;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < M; ++j)
            if (j == M - 1 - i)
                S = S + Y[i][j];
    cout << "Sum of adverse diagonal of array: " << S << endl;

    //находим сумму всех элементов матрицы
    int Sum = 0;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < M; ++j)
            Sum = Sum + Y[i][j];
    cout << "Sum of all elements of array: " << Sum << endl;
    return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота