摘要: ' Declare the necessary Windows API functions Private Declare PtrSafe Function CreateToolhelp32Snapshot Lib "kernel32" ( _ ByVal dwFlags As Long, _ By 阅读全文
posted @ 2024-06-12 14:29 梓涵VV 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import random MAX_SIZE = 5 def print_board(board): # 打印棋盘,并加上行号和列号 print("\t" + "\t".join(str(i) for i in range(1, MAX_SIZE + 1))) for i in range(MAX_ 阅读全文
posted @ 2024-05-10 17:24 梓涵VV 阅读(6) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> typedef struct Node{ int value; struct Node *pNext; } Node; /* 打印链表 */void show_data(Node *he 阅读全文
posted @ 2023-06-19 10:28 梓涵VV 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1. 使用set(),是一个无序不重复元素集(重新排序) inList = [55,21,0,3,17,17,5] outList = list(set(inList)) print (outList) 结果: [0,3,5,17,21,55] 2. 使用keys()方法(重新排序) inList 阅读全文
posted @ 2022-08-06 20:00 梓涵VV 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1 static bool OutDeviceMountStateChk() 2 { 3 FILE *fstream = NULL; 4 char infotime[30]; 5 6 char errMessage[48]; 7 int nRet = -1; 8 9 struct mntent *e 阅读全文
posted @ 2022-08-03 22:10 梓涵VV 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 static eRESULT GetHDDStatus() 2 { 3 FILE *fstream = NULL; 4 char command_str[50]; 5 char buff[256]; 6 char strtmp[256]; 7 char find_Status[50] = "St 阅读全文
posted @ 2022-08-03 22:01 梓涵VV 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1 @echo off 2 setlocal enabledelayedexpansion 3 4 set INIFILE=%1 5 6 rem 7 rem ini内容解析 8 rem 9 for /f "delims=" %%i in (%INIFILE%) do ( 10 set rowStr= 阅读全文
posted @ 2022-07-27 15:45 梓涵VV 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 int SearchSingleNum(int *num, int size) 2 { 3 int i = 0; 4 int tmp = 0; 5 int iRt = 0; 6 7 for (i = 0; i < size; i++) { 8 iRt = ~tmp & (iRt ^ num[i] 阅读全文
posted @ 2021-04-30 13:32 梓涵VV 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 方式使用场景 static_cast 基本数据类型之间的转换使用,例如float转int,int转char等;子类对象指针转换成父类对象指针也可以使用static_cast;在有类型指针和void*之间转换使用,不能使用static_cast在有类型指针之间进行类型转换。 dynamic_cast 阅读全文
posted @ 2020-12-30 11:50 梓涵VV 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 基数排序是一种非比较型整数排序算法,其原理是将整数按位数切割成不同的数字,然后按每个位数分别比较。 基数排序有两种方法: 这三种排序算法都利用了桶的概念,但对桶的使用方法上有明显差异: 基数排序:根据键值的每位数字来分配桶; 计数排序:每个桶只存储单一键值; 桶排序:每个桶存储一定范围的数值; Ja 阅读全文
posted @ 2020-12-29 13:41 梓涵VV 阅读(120) 评论(0) 推荐(0) 编辑