摘要: 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 阅读全文
posted @ 2021-03-29 20:14 tao10203 阅读(41) 评论(0) 推荐(0)
摘要: #include <unistd.h> int pipe(int pipefd[2]); 功能:创建一个匿名管道,用来进程间通信。 参数:int pipefd[2] 这个数组是一个传出参数。 pipefd[0] 对应的是管道的读端 pipefd[1] 对应的是管道的写端 返回值: 成功 0 失败 - 阅读全文
posted @ 2021-03-29 17:14 tao10203 阅读(160) 评论(0) 推荐(0)