pizniak
?>

5. Найдите синтаксические ошибки в записи команд: (1 if 5 then S:=S+5; (2). if B then x:=y; else B:=x; (3). if x=y then x:=1; else x:=0; (4). if (A=B) and P then P:=P+12; (5). if (A (6). if P then P:='a=b'; (7). if x>y then begin x:=y else x:=z end; (8). if C then A:=0 else C:=2; (9). if x="false" then write ("ложь") else x:=true; (10). if X or Y then begin write (Z) else write (T) end;

Информатика

Ответы

art-03857
// PascalABC.NET 3.1, сборка 1201 от 18.03.2016
begin
  var n:=ReadInteger('n=');
  var m:=18;
  var a:=MatrixRandom(m,n,-999,999);
  var imax:=0;
  var jmax:=0;
  for var i:=0 to m-1 do begin
    for var j:=0 to n-1 do begin
      Write(a[i,j]:5);
      if abs(a[i,j])>abs(a[imax,jmax]) then begin
        imax:=i; jmax:=j
        end
      end;
    Writeln
    end;
  Writeln('Максимум по модулю А[',imax+1,',',jmax+1,
      ']=',a[imax,jmax])
end.

Тестовое решение:
n= 10
 -275  257 -860  744 -263  843    8  667  425 -547
 -392  635  636 -441  -64  973  201 -864 -126 -868
 -764   43 -884 -667 -113  807  354  966 -155 -527
  532 -790 -911    0 -303 -471  453  431 -741 -582
 -121  548 -946  610  724 -426  963 -589 -591  845
 -846  629  728  634 -581  681  141  807 -142  -70
 -510   42 -177  -48  -80 -601  547 -364  862 -593
 -480  770  876 -544  253 -312  -11 -494 -391 -687
  843  -56  558    0 -681  903 -519 -545 -418   15
  387  646 -427  329  928  837 -274  101 -310  325
   27  327 -452 -998  325 -616  752  273 -619  731
 -307 -364  199 -454   86  546  483  823 -367   17
  917   92 -945 -152   19 -126  198 -453 -473  416
  961  888  815  283  286 -483 -604  557  674  935
 -849  207 -926 -149 -677 -248 -552 -972 -756 -617
 -646  -97 -532  673  407  934  272  700  -18 -548
  186  206 -253  -35  769 -196 -179  915  259 -431
  151  926 -851 -302 -134 -289   19  204 -474 -732
Максимум по модулю А[11,4]=-998

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

5. Найдите синтаксические ошибки в записи команд: (1 if 5 then S:=S+5; (2). if B then x:=y; else B:=x; (3). if x=y then x:=1; else x:=0; (4). if (A=B) and P then P:=P+12; (5). if (A (6). if P then P:='a=b'; (7). if x>y then begin x:=y else x:=z end; (8). if C then A:=0 else C:=2; (9). if x="false" then write ("ложь") else x:=true; (10). if X or Y then begin write (Z) else write (T) end;
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

zybin41iz81
skorpion7228528
Nastyaches4
galinazajceva781
Калмыкова-Петрунина
maslprod
mileva84
nairahay
in-1973
Margarita
Lerkinm
galiyamart6671
terehin863
mrilyushchenko6
akakne86