FuzziBoy
23.05.2021 03:11

ЧТО ДЕЛАЕТ ЭТОТ КОД ЧЕРЕЗ vbs Set WshShell = CreateObject("WScript.Shell")

regKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"

DigitalProductId = WshShell.RegRead(regKey & "DigitalProductId")

Win8ProductName = "Windows Product Name: " & WshShell.RegRead(regKey & "ProductName") & vbNewLine

Win8ProductID = "Windows Product ID: " & WshShell.RegRead(regKey & "ProductID") & vbNewLine

Win8ProductKey = ConvertToKey(DigitalProductId)

strProductKey ="Windows Key: " & Win8ProductKey

Win8ProductID = Win8ProductName & Win8ProductID & strProductKey

MsgBox(Win8ProductKey)

MsgBox(Win8ProductID)

Function ConvertToKey(regKey)

Const KeyOffset = 52

isWin8 = (regKey(66) \ 6) And 1

regKey(66) = (regKey(66) And &HF7) Or ((isWin8 And 2) * 4)

j = 24

Chars = "BCDFGHJKMPQRTVWXY2346789"

Do

Cur = 0

y = 14

Do

Cur = Cur * 256

Cur = regKey(y + KeyOffset) + Cur

regKey(y + KeyOffset) = (Cur \ 24)

Cur = Cur Mod 24

y = y -1

Loop While y >= 0

j = j -1

winKeyOutput = Mid(Chars, Cur + 1, 1) & winKeyOutput

Last = Cur

Loop While j >= 0

If (isWin8 = 1) Then

keypart1 = Mid(winKeyOutput, 2, Last)

insert = "N"

winKeyOutput = Replace(winKeyOutput, keypart1, keypart1 & insert, 2, 1, 0)

If Last = 0 Then winKeyOutput = insert & winKeyOutput

End If

a = Mid(winKeyOutput, 1, 5)

b = Mid(winKeyOutput, 6, 5)

c = Mid(winKeyOutput, 11, 5)

d = Mid(winKeyOutput, 16, 5)

e = Mid(winKeyOutput, 21, 5)

ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e

End Function

​

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
Ученик132312
22.09.2022 14:27

#include <iostream>

int main() {

const int SIZE = 10;

bool isSence = false;

int sum = 0;

int count = 0;

int arr[SIZE];

for (int i = 0; i < SIZE; i++)

{

 arr[i] = rand() % 20 - 10; // "рандомно" заполняем массив от -10 до 10

 std::cout << arr[i] << "\t"; // выводим массив в консоль

 if (arr[i] >= 0)

  isSence = true;

}

for (int i = 0; i < SIZE; i++)

{

 if ((isSence) && (arr[i] > 0))

  sum += arr[i]; //sum = sum + arr[i];

  count++;

}

if (isSence)

 std::cout << "\nсреднее арифметическое положительных чисел = " << double(sum) / count << std::endl; // явное приведение типов

else

 std::cout << "\nВ массиве нету положительных чисел или нету нулей и/или отрицательных чисел" << std::endl;

return 0;

}

0,0(0 оценок)
Ответ:
robiya86
22.07.2020 13:22
Только программа, блок-схему не знаю
#include <iostream>
#include <iomanip>
#include <vector>
#include <ctime>
int main()
{
    using namespace std;

    const int n = 5;
    int A[n][n];
    int D[n][n];
    vector<int> B(n);
    vector<int> C(n);
    vector<int> S(n);   //результирующий вектор

    //как-нибудь заполняем исходные матрицы и вектора
    srand(time(0));
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
        {
            A[i][j] = rand() % (n * n) - n * n / 2;
            D[i][j] = rand() % (n * n) - n * 2;
        }
        B[i] = rand() % (n * n) - n;
        C[i] = rand() % (n * n) - n * n + n;
    }

    //выведем исходные данные на экран
    cout << "matrix A:\n";
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout << setw(5) << A[i][j];
        cout << endl;
    }

    cout << "\nmatrix D:\n";
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout << setw(5) << D[i][j];
        cout << endl;
    }

    cout << "\nvector B:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << B[i] << endl;

    cout << "\nvector C:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << C[i] << endl;

    //вычислим требуемое
    for (int i = 0; i < n; ++i)
    {
        S[i] = 0;
        for (int j = 0; j < n; ++j)
            S[i] += D[i][j] * C[j];
        S[i] += 3 * B[i];
    }

    //выведем результат на экран
    cout << "\nvector S = D * C + 3 * B:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << S[i] << endl;

    return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота