Программа с нод var t,t1,x,y,z: integer; function nod(a, b: integer): integer; begin if a=b then nod: =a else if a> b then nod: =nod(a-b, b) else nod: =nod(a, b-a); end; begin writeln('введите 2 числа'); readln(x,y); t: =nod(x,y); writeln(t); end.
Elen-Fler
21.03.2022
Sub m1() cells.clear dim n as integer, i as integer, s as integer n = inputbox("n = ") cells(1, 1).value = "n = " + str(n) redim a(1 to n) for i = 1 to n a(i) = inputbox("a(" + str(i) + ")") next i cells(2, 1).value = "исходный массив" range(cells(3, 1), cells(3, = a s = 0 for i = 1 to n s = s + a(i) next i cells(4, 1).value = "s = " + str(s) cells(5, 1).value = "полученный массив" for i = 1 to n a(i) = a(i) + s next i range(cells(6, 1), cells(6, = a end sub
Lolira64
21.03.2022
Sub m2() cells.clear dim n as integer, i as integer, min as integer n = inputbox("n(> 5) = ") cells(1, 1).value = "n = " + str(n) redim a(1 to n) for i = 1 to n a(i) = inputbox("a(" + str(i) + ")") next i cells(2, 1).value = "исходный массив" range(cells(3, 1), cells(3, = a min = a(1) for i = 2 to n if a(i) < min then min = a(i) next i cells(4, 1).value = "min = " + str(min) cells(5, 1).value = "полученный массив" for i = n - 4 to n a(i) = min next i range(cells(6, 1), cells(6, = a end sub