摘要:
##Socket函数 #include <sys/types.h> #include <sys/socket.h> int socket(int domain, int type, int protocol); domain 协议族: AF_OCAL, AF_INT, AF_INET7 type S 阅读全文
摘要:
###查找第一个不大于x的值 bool BinarySearch(int i, int j, vector<int> nums, int target) { while (i < j) { int mid = (j - i) / 2 + i; if (nums[mid] <= target) i = 阅读全文
摘要:
class Solution { public: int add(int a, int b) { int c; while(b!=0){ c=(unsigned int)(a&b)<<1;//进位 a^=b;//a+b b=c;//进位赋给b,直到没有进位,因为a加上进位可能还产生进位 } retu 阅读全文
摘要:
class Solution { public: string reverseWords(string s) { int n = s.size(); string ans = ""; for (int i = n - 1; i >= 0; i--) { if (s[i] != ' ') { int 阅读全文
摘要:
####IPC: Inter Processes Communication 进程是一个独立的资源分配单位,不同进程(用户进程)的资源是独立的,没有关联,不能在一个进程中直接访问另一个进程的资源。 但是进程不是孤立的,不同的进程需要进行信息的交互和状态的传递等,因此需要进程间通信 ####进程间通信 阅读全文
摘要:
1103 Integer Factorization (30分) The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You 阅读全文