Const nx=30;mx=30;
var i,j,n,m:integer;A:array[1..nx,1..mx] of integer;B,D:array[1..nx] of integer;
begin
write('Введите n');Readln(n);
write('Введите m');Readln(m);
for i:=1 to n do begin
for j:=1 to m do вegin
A[i,j]:=random(100)-20;
write(A[i,j]:4);end;writeln;end;writeln;
for i:=1 to n do begin
for j:=1 to m do begin
if (A[i,j] mod 3 =0) then begin
B[i]:= B[i] + A[i,j];write(A[i,j]:4);D[i]:= D[i] + 1;end;end;writeln;end;
for i:=1 to n do begin
if (B[i]=0) and (D[i]= 0) then B[i]:= -10;
write(B[i]:4);end;<span>end.</span>
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
using namespace std;
int main ()
{
short int x1,y1,x2,y2;
cout << "Input x1: ";
cin>> x1;
cout<<endl<<"Input y1: ";
cin>> y1;
cout << "Input x2: ";
cin>> x2;
cout<<endl<<"Input y2: ";
cin>> y2;
if ((abs(x2-x1)!=1) || (abs(y2-y1) !=2))
{cout<<"NOT";} else
{cout<<"OK"<<endl;}
system("PAUSE");
return 0;
Подробное решение внутри файла