- 博客(14)
- 收藏
- 关注
原创 【VIM】VIM
vim --version 查看vim版本输入vim进入,默认状态下是normal 模式,输入的是命令而不是文本:q 退出:q! 强制退出i 进入编辑状态,光标前插入a 进入编辑状态,光标前插入o 进入编辑状态,光标下一行插入esc 返回normal状态:wq w存盘+q退出:w 新文件名+后缀 保存新编辑好的文件vim 文件名+后缀 查看文件x normal 状态下删除字符dd normal状态下删除一整行:help 查看帮助0 快速移动到行首部$ 快速移动到行尾部/查找的
2022-02-19 14:22:14
576
原创 【SHELL】SHELL命令
SHELL命令WHOSUDOSUDO APT-GET UPDATESUDO APT-GET UPGRADESUDO APT-GET DISK-UPGRADEPWDMAN + 命令行LSLS /CDTOUCHWHO查询有谁登陆过SUDO以最高权限登录SUDO APT-GET UPDATE下载最新的资源信息,并不下载真正的软件包SUDO APT-GET UPGRADE比较软件包中哪些是旧的,并下载新软件包更新SUDO APT-GET DISK-UPGRADE内核更新,版本更新PWD查询当
2022-02-18 03:29:13
273
原创 CCF2021-9-19
一共五道题目,可以带参考书和纸笔进考场,忘了带纸笔,带了本参考书没用上,总体做的情况不太好。第一题和第二题都是使用数组,第一道题拿了满分,第二题70,后面数据貌似超时了,结束后请教了监考老师,应该是有些特殊情况我没有注意到。第三题题目很长,要求实现一个神经网络,没看懂题目啥意思,另外要求保留三位小数,我忘了用哪个保留小数位了,总之研究了很久拿了个鸭蛋。第四题感觉像是数学的概率题,靠其中一组等概率的数据骗到了20分。第五题题目也很长,没来的仔细看。满分500分,只拿到了190分,还是挺打击人的。放弃
2021-09-19 23:35:55
298
原创 CCF202104-1灰度直方图(C++实现)
http://118.190.20.162/view.page?gpid=T128#include <iostream>using namespace std;int main() { int n,m,L; cin>>n; cin>>m; cin>>L; int **p=new int*[n]; for(int i=0;i<n;i++) p[i]=new int[m]; int *q=new int [L]
2021-09-17 00:43:43
490
原创 <操作系统> 理发店问题(选做)C语言实现
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t customers,barbers,mutex,wanttosit,pay,over,cash_r;int waiting=0;void *barber_1(void*arg
2021-04-10 00:12:16
1896
1
原创 <操作系统>读者写者问题(写者优先)C语言实现
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t mrc,mwc,wr,wsem,rsem;int readcount=0;int writecount=0;void *read_i(int a){ printf(
2021-04-10 00:09:41
2464
原创 <操作系统>读者写者问题(读者优先)C语言实现
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t mutex,ws;int readercount=0;int readernum;void *read_i(int a){ printf("第%d号读者想读\n"
2021-04-10 00:05:59
3504
3
原创 <操作系统>读者写者问题(公平竞争)C语言实现
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t rmutex,wmutex,s;int count;void *read_i(int a){ printf("第%d号读者想读\n",a+1); sem_wait
2021-04-10 00:03:54
1023
原创 <操作系统>生产者消费者问题—无限缓冲区(C语言实现)
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t full,mutex;int a=0;void *producer_i(void *arg){ while(1){ sleep(1); sem_wait(&mu
2021-04-09 23:55:20
1435
原创 <操作系统>生产者与消费者问题—单个缓冲区(C语言实现)
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t empty,full;void *producer_i(void *arg){ while(1){ sleep(1); sem_wait(&empty);
2021-04-09 23:53:54
1364
原创 <操作系统>生产者消费者问题—共享有限缓冲区(C语言实现)
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>#define maxsize 10int product[maxsize]={0};sem_t empty,full,mutex;int in,out;void *producer_
2021-04-09 23:51:56
1752
1
原创 <操作系统> 售票员司机问题(信号量) C语言实现
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <semaphore.h>sem_t door,stop; //设置关门和停车两个信号量void *thread_driver(void *arg) //司机线程{
2021-04-09 23:47:44
3030
4
原创 string输入输出txt的小例子
关于string的小例子文本文件Readline#include <iostream>#include <string>using namespace std;int main() { string s; while(getline(cin,s)) cout<<s<<endl; return 0;}运行效果从工程中找出exe文件exe文件运行效果命令行运行读文本文件Readword将getline换成cin
2021-01-01 04:57:48
307
原创 <STL>学习string
#STL stringhttps://www.bilibili.com/video/BV1P7411k7Km?p=17①四种初始化方法string s1;string s2("hello!");string s3(s2);string s4(10
2021-01-01 04:24:10
333
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人