摘要: 标准输入输出 格式化输入输出 int a,b; int arr[10]={1},*p=&b; double d; char ch,str[30]; scanf("%d%d",&a,p); scanf("%c%s",&ch,str); scanf("%lf",&d); scanf("%d%d",arr 阅读全文
posted @ 2017-10-08 20:46 徐王 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 实验要求: 创建两个线程按数字顺序打印10以下自然数,其中一个线程打印1-3及8-10;另一个线程打印4-6。要求使用线程同步机制实现上述打印顺序。 看网上的资料学习了两种写法 C++11的,使用了std::thread 1 #include <unistd.h> 2 #include <threa 阅读全文
posted @ 2017-04-06 17:40 徐王 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 转自阮一峰的网络日志 如何为代码选择开源许可证,这是一个问题。 世界上的开源许可证,大概有上百种。很少有人搞得清楚它们的区别。即使在最流行的六种 GPL、BSD、MIT、Mozilla、Apache和LGPL 之中做选择,也很复杂。 乌克兰程序员Paul Bagwell,画了一张分析图,说明应该怎么 阅读全文
posted @ 2017-03-26 20:07 徐王 阅读(174) 评论(0) 推荐(0) 编辑
摘要: gdb使用 转自清华大学操作系统实验指导书 gdb 是功能强大的调试程序,可完成如下的调试任务: 设置断点 监视程序变量的值 程序的单步(step in/step over)执行 显示/修改变量的值 显示/修改寄存器 查看程序的堆栈情况 远程调试 调试线程 在可以使用 gdb 调试程序之前,必须使用 阅读全文
posted @ 2017-03-23 21:34 徐王 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 好吧,很久没有做leetcode了,因为感觉没什么用啊,我又不找工作(别找借口了,就是懒。) 学习一下git的使用吧。。。 首先是从github上下载项目 git clone https://github.com/fffgrdcc/ucore_os_lab 然后是链接其他代码源 git remote 阅读全文
posted @ 2017-03-23 20:18 徐王 阅读(147) 评论(0) 推荐(0) 编辑
摘要: ji那天居然早起了,惊呆我了,眼睛有点儿疼,一直流泪。。。。继续保持 leetcode4 Median of Two Sorted Arrays leetcode11 Container With Most Water leetcode15 3Sum 4讲的是给你n个有序数字,再给你m个有序数字,让 阅读全文
posted @ 2017-03-13 11:18 徐王 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 对于每次开机avast喊出的“已经检测到危害”实在忍无可忍了(它只能检测到不能根除很气。。)于是重装了系统,回到了win10感觉不赖。 leetcode167 Two Sum II leetcode209 Minimum Size Subarray Sum leetcode216 Co 阅读全文
posted @ 2017-03-12 14:32 徐王 阅读(217) 评论(0) 推荐(0) 编辑
摘要: ji那天好像是周六。。。。。吃完饭意识到貌似今天要有比赛(有题解当然要做啦),跑回寝室发现周日才开始233333 leetcode217 Contains Duplicate leetcode219 Contains Duplicate II leetcode228 Summary Ranges 2 阅读全文
posted @ 2017-03-11 15:17 徐王 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 今天登陆leetcode突然发现531被锁了,有种占了便宜的感觉哈哈哈! leetcode229 Majority Element II leetcode238 Product of Array Except Self leetcode268 Missing Number 229讲的是给你n个数字, 阅读全文
posted @ 2017-03-10 16:49 徐王 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 今天操作系统课,没能安心睡懒觉23333,妹抖龙更新,可惜感觉水分不少。。。。怀念追RE0的感觉 leetcode283 Move Zeroes leetcode287 Find the Duplicate Number leetcode289 Game of Life 283讲的是给你一个数组,其 阅读全文
posted @ 2017-03-09 15:57 徐王 阅读(172) 评论(0) 推荐(0) 编辑