#include<iostream>#include<string>#include<sstream>#include<iomanip>#include<Windows.h>#include<iphlpapi.h>// 包含这个头文件以获取 PIP_ADAPTER_INFO#include<intrin.h>// 包含这个头文件以使用 __cpuid#pragmacomment(lib,"IPHLPAPI.lib")// 链接到IPHLPAPI.lib库// Function to get CPU serial number
std::string GetCPUSerialNumber(){std::string result;int cpuInfo[4]={-1};__cpuid(cpuInfo,1);unsignedint lowPart = cpuInfo[3];unsignedint highPart = cpuInfo[0];std::stringstream stream;stream << std::hex << highPart << std::hex << lowPart;result = stream.str();return result;}// Function to get hard disk serial number
std::string GetHardDiskSerialNumber(){std::string result;DWORD dwVolumeSerialNumber;GetVolumeInformationA("C:\\",NULL,0,&dwVolumeSerialNumber,NULL,NULL,NULL,0);std::stringstream stream;stream << std::hex << std::setw(8)<< std::setfill('0')<< dwVolumeSerialNumber;result = stream.str();return result;}// Function to get MAC address of the first network adapter
std::string GetMACAddress(){std::string result;PIP_ADAPTER_INFO pAdapterInfo;ULONG ulOutBufLen =sizeof(PIP_ADAPTER_INFO);pAdapterInfo =(IP_ADAPTER_INFO*)malloc(sizeof(IP_ADAPTER_INFO));if(pAdapterInfo !=NULL){if(GetAdaptersInfo(pAdapterInfo,&ulOutBufLen)== ERROR_BUFFER_OVERFLOW){free(pAdapterInfo);pAdapterInfo =(IP_ADAPTER_INFO*)malloc(ulOutBufLen);}if(GetAdaptersInfo(pAdapterInfo,&ulOutBufLen)== NO_ERROR){result = pAdapterInfo->Address[0];}free(pAdapterInfo);}return result;}// Function to generate unique machine ID
std::string GenerateMachineID(){std::string cpuSerial =GetCPUSerialNumber();std::string diskSerial =GetHardDiskSerialNumber();std::string macAddress =GetMACAddress();std::string machineID = cpuSerial + diskSerial + macAddress;return machineID;}intmain(){std::string machineID =GenerateMachineID();std::cout <<"Machine ID: "<< machineID << std::endl;return0;}
1、下载安装nodejs
地址:Node.js — Run JavaScript Everywhere
2、git下载 elasticsearch-head 源码
地址:GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster
3、使用cmd 进入 elasticsearch-head 目录
4、依次执…
6.第K小的和 - 蓝桥云课 (lanqiao.cn) #include <bits/stdc.h>
#define int long long
#define endl \n
using namespace std;
int n,m,k,an[100005],bm[100005];
int check(int x){int res0;//序列C中<x的数的个数for(int i0;i<n;i){//遍历数组A,对于每…