Private Sub CommandButton1_Click() Dim s() As Integer, n As Integer, m As Integer Dim i As Integer, j As Integer Dim min As Integer, max As Integer, q As Integer, w As Integer Cells.Clear n = InputBox("CTROKI", , 4) m = InputBox("CTOLBEC", , 5) Randomize ReDim s(n, m) As Integer For i = 1 To n max = -100: min = 100 For j = 1 To m s(i, j) = Int(Rnd() * 60 - 10) Cells(i, j) = s(i, j) Cells(i + 2 + n, j) = s(i, j) If min > s(i, j) Then min = s(i, j) q = j End If If max < s(i, j) Then max = s(i, j) w = j End If Next j Cells(i + 2 + n, w) = min Cells(i + 2 + n, q) = max Next i End Sub
{ввожу текст, затем слово. Переменная flag нужна для того, чтобы в нее записать 1, если из слова встретиться в тексте хотя бы раз буква. Если это случилось, то Flag становится равной 1. К буквам слова и текста обращаемся как к массиву a[i] b[j]} var a,b:string; i,n,k,j,flag:integer; begin flag:=0; writeln('Введите текст'); readln(a); Writeln('Введите слово'); Readln(b); k:=length(a); n:=length(b); for i:=1 to n do for j:=1 to k do if a[i]=b[j]then flag:=1; if flag=1 then writeln('Y') else writeln('N'); end.
Dim s() As Integer, n As Integer, m As Integer
Dim i As Integer, j As Integer
Dim min As Integer, max As Integer, q As Integer, w As Integer
Cells.Clear
n = InputBox("CTROKI", , 4)
m = InputBox("CTOLBEC", , 5)
Randomize
ReDim s(n, m) As Integer
For i = 1 To n
max = -100: min = 100
For j = 1 To m
s(i, j) = Int(Rnd() * 60 - 10)
Cells(i, j) = s(i, j)
Cells(i + 2 + n, j) = s(i, j)
If min > s(i, j) Then
min = s(i, j)
q = j
End If
If max < s(i, j) Then
max = s(i, j)
w = j
End If
Next j
Cells(i + 2 + n, w) = min
Cells(i + 2 + n, q) = max
Next i
End Sub
var
a,b:string;
i,n,k,j,flag:integer;
begin
flag:=0;
writeln('Введите текст');
readln(a);
Writeln('Введите слово');
Readln(b);
k:=length(a);
n:=length(b);
for i:=1 to n do
for j:=1 to k do
if a[i]=b[j]then
flag:=1;
if flag=1 then
writeln('Y')
else
writeln('N');
end.