Var chislo:integer; proverka:boolean; begin proverka:=true; read(chislo); repeat if chislo=0 then //так как 0 не натуральное число begin proverka:=false; break; end; if (chislo mod 3)>0 then begin proverka:=false; break; end else chislo:=chislo div 3; until(chislo=0); if proverka then WriteLn('Да') else WriteLn('Нет'); readln; end.
№1 DATA 11,12,14,9,7,6,11,-20,55,333,222,111,11,900,-100,23,16,17,30,21,22,24,55,4444,500 DIM A(25) FOR I=1 TO 25 READ A(I) PRINT A(I) NEXT FOR I=1 TO 25 FOR J=1 TO 24 IF A(J)<A(J+1) THEN SWAP A(J),A(J+1) NEXT NEXT PRINT "SUMMA 4ETIREH NAIBOLSHIH=";A(1)+A(2)+A(3)+A(4) PRINT "SUMMA 4ETIREH NAIMENSHIH=";A(25)+A(24)+A(23)+A(22) №2 CLS INPUT "n"; n DIM a(1 TO n), B(1 TO n) FOR i = 1 TO n a(i) = INT(RND * 100) B(i) = INT(RND * 100) PRINT a(i), B(i) NEXT i imin = 0 min = B(1) FOR i = 1 TO n IF B(i) < min THEN imin = i IF i > imin THEN s = s + a(i): k = k + 1 NEXT i sr = s / k PRINT PRINT "imin"; imin PRINT "Sr"; sr
proverka:boolean;
begin
proverka:=true;
read(chislo);
repeat
if chislo=0 then //так как 0 не натуральное число
begin
proverka:=false;
break;
end;
if (chislo mod 3)>0 then
begin
proverka:=false;
break;
end
else chislo:=chislo div 3;
until(chislo=0);
if proverka then WriteLn('Да')
else WriteLn('Нет');
readln;
end.
DATA 11,12,14,9,7,6,11,-20,55,333,222,111,11,900,-100,23,16,17,30,21,22,24,55,4444,500
DIM A(25)
FOR I=1 TO 25
READ A(I)
PRINT A(I)
NEXT
FOR I=1 TO 25
FOR J=1 TO 24
IF A(J)<A(J+1)
THEN SWAP A(J),A(J+1)
NEXT
NEXT
PRINT "SUMMA 4ETIREH NAIBOLSHIH=";A(1)+A(2)+A(3)+A(4)
PRINT "SUMMA 4ETIREH NAIMENSHIH=";A(25)+A(24)+A(23)+A(22)
№2
CLS
INPUT "n"; n
DIM a(1 TO n), B(1 TO n) FOR i = 1 TO n a(i) = INT(RND * 100) B(i) = INT(RND * 100) PRINT a(i), B(i) NEXT i imin = 0 min = B(1) FOR i = 1 TO n IF B(i) < min THEN imin = i IF i > imin THEN s = s + a(i): k = k + 1 NEXT i sr = s / k PRINT PRINT "imin"; imin PRINT "Sr"; sr