头文件 #include <signal.h> #include <time.h> 创建定时器 int timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid); ...
分类:
其他好文 时间:
2021-04-26 13:55:59
阅读次数:
0
1. 判断是否是基础数据类型 /** * 判断是否是基础数据类型,即 int,double,long等类似格式 */ public static boolean isCommonDataType(Class clazz){ return clazz.isPrimitive(); } 2、 判断是否是 ...
分类:
其他好文 时间:
2021-04-26 13:54:00
阅读次数:
0
线程 创建线程 #include <pthread.h> int pthread_create(pthread_t *restrict thread,const pthread_attr_t *restrict attr,void *(*start_routine)(void*), void *re ...
分类:
其他好文 时间:
2021-04-26 13:53:31
阅读次数:
0
思路: 模拟。 实现: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode() : val(0), next(nullptr) ...
分类:
其他好文 时间:
2021-04-26 13:49:52
阅读次数:
0
Insertion Sort(插入排序) 思路:for 循环遍历数组中的每一个数 用while将每次遍历到的数于左侧的数进行对比,将小的排到左边 void InsertionSort(int*A, int n){ int key,i=0,p; for(p=0;p<n;p++){ key=A[p]; ...
分类:
其他好文 时间:
2021-04-26 13:48:01
阅读次数:
0
完全数 : 其所有因子的的和等于该数(包括1,但是不包括该数字本身) package judgment;/** * 求1~1000的所有完全数 */public class Judgment { public static void main(String[] args) { for (int i ...
分类:
其他好文 时间:
2021-04-26 13:45:19
阅读次数:
0
First reader and writers problem (读者优先) no reader be kept waiting unless a writer has obtain permission to write semaphore rw=1, readcnt_m=1; int read ...
分类:
其他好文 时间:
2021-04-26 13:39:39
阅读次数:
0
思路: def new_ton(num): if num == 0: return 0 res = int(sqrt(num, num)) print(res) def sqrt(n, x): cur = (n + x/n) / 2 if cur == n: return cur else: ret ...
分类:
其他好文 时间:
2021-04-26 13:26:36
阅读次数:
0
系统:win10 今天在使用控制台打印内容时, 发现个人对制表符不是很清楚,在此记录,以便日后查阅. 分割线 函数: int printf(const char* _Format, ...) 注1:这货竟然有返回值, 返回输出的字符数量 注2:关于输出乱码的问题:printf打印,包括Qt控件上显示 ...
分类:
其他好文 时间:
2021-04-26 13:25:33
阅读次数:
0
命令行传参 package test4; public class CommandLineParam { public static void main(String[] args) { for (int i=0; i<args.length; i++){ System.out.println("a ...
分类:
其他好文 时间:
2021-04-26 13:20:29
阅读次数:
0