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
#include <conio.h>
#include <time.h>
using namespace std;
void main()
{
srand(time(NULL));
setlocale(0, "");
int arr[17];
int a, b, chet=0, nechet = 0;
cout << "Введите диапазон ." << endl << "Нижняя граница диапазона: "; cin >> a; cout << "Верхняя граница диапазона: "; cin >> b; cout << endl;
for (int i = 0; i < 17; ++i)
{
arr[i] = a + rand() % (b-a+1);
cout <<" "<<arr[i];
}
for (int i = 0; i < 17; ++i)
{
if (arr[i] % 2 == 0) chet++;
else nechet++;
} if (chet > nechet)
cout << " \n Четных больше";
else if (nechet>chet)
cout << "\n Нечетных больше";
else cout << "\n Одинаковое количество четных и нечетных";
_getch();
}
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