Sub Ìàêðîñ1() Dim Sum(heigth - 1, width - 1) Dim Product(heigth - 1, width - 1)
For i = 0 To heigth - 1 For j = 0 To width - 1 Sum(i, j) = i + j Product(i, j) = i * j Next j Next i
Call Show(Sum, 0, 0) Call Show(Product, 0, 12) End Sub
Sub Show(ByRef m, dx, dy) For i = 0 To heigth - 1 For j = 0 To width - 1 ActiveSheet.Cells(dx + i + 1, dy + j + 1).Value = Hex(m(i, j)) Next j Next i End Sub
Var St: string; z:string[10]; x:string[2]; i,j,k,m: integer; //новые переменные Begin Write('введите строку текста - St'); Readln(St); k:=0; //обнуляем на всякий случай z:='0123456789'; i:=1; for j:=1 to length(St) do //начало begin; for m:=1 to 10 do if St[j]=z[m] then inc(k); end; if k=0 then begin; writeln('в тексте нет цифр'); exit; end; //конец while i<=length(st)-1 do begin x:=copy(st,I,2); if (x[1]=x[2]) and (pos(x[1],z)<>0) then begin delete(st,i,2); insert('две',st,i); i:=i+1; end; i:=i+1; end; writeln('преобразованная строка ', st); End.
Const width = 10
Sub Ìàêðîñ1()
Dim Sum(heigth - 1, width - 1)
Dim Product(heigth - 1, width - 1)
For i = 0 To heigth - 1
For j = 0 To width - 1
Sum(i, j) = i + j
Product(i, j) = i * j
Next j
Next i
Call Show(Sum, 0, 0)
Call Show(Product, 0, 12)
End Sub
Sub Show(ByRef m, dx, dy)
For i = 0 To heigth - 1
For j = 0 To width - 1
ActiveSheet.Cells(dx + i + 1, dy + j + 1).Value = Hex(m(i, j))
Next j
Next i
End Sub