N1:
Код
Program to_jackal;
Uses Crt;
Var
str : string;
S :integer;
code:integer;
k :integer;
i :integer;
begin
ClrScr;
Write('Input string -> '); Readln(str);
i:=1;S:=0;
while (str[i]<>'.') do
begin
if (str[i]>='1') and (str[i]<='9') then
begin
Val(str[i],k,code);
S:=S+k;
end;
i:=i+1;
end;
if S=length(str) then Writeln('YES!') else Writeln('NO!');
Readln;
end.
N2:
Код
Program to_jackal_2;
Uses Crt;
Const N=3;
Type Matrix = Array [1..N,1..N] of Integer;
Var A : Matrix;
ii,jj : Integer;
k : Integer;
Function Test(A1:Matrix; kk:integer):boolean;
Var
Min:Integer;
Max:Integer;
i,j:Integer;
ki:Integer;
t,z:Integer;
begin
Min:=A1[k,1];
For i:=1 to n do
if A1[kk,i] < Min then Min:=A1[kk,i];
Max:=A[1,k];
For i:=1 to n do
if A1[i,k] > Max then Max:=A1[i,k];
if (Min=Max) then Test:=True else Test:=False;
end;
Begin
ClrScr;
Randomize;
For ii:=1 to N do
For jj:=1 to N do
Readln(a[ii,jj]);
Write('Input k: ');Readln(k);
Writeln(Test(a,k));
Readln;
end.