- 博客(67)
- 资源 (10)
- 收藏
- 关注
原创 C++中的引用与指针的区别
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-
2014-09-01 19:20:57
679
原创 【转载】【素材】闪烁的背景图
<table border="1" cellspacing="1" bordercolor="#7F05FB"cellpadding="1" width="100%"><a href="http://img.blog.163.com/photo/KhTOA87rJZ9qaWWFV6dnLw==/578149602164182467.jpg"><img title="【素材】闪烁的背
2014-09-01 19:20:54
822
原创 【转载】Ubuntu下嵌入式Qt开发环境…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><span style="FONT-SIZE: 14pt;"><span style="FONT-FAMILY: 宋体;"> 本
2014-09-01 19:20:52
1131
原创 【转载】MFC实现串口通信编程 - yu…
MFC实现串口通信编程vc++、c#专题 2009-10-0822:32在Windows应用程序的开发中,我们常常需要面临与外围数据源设备通信的问题。计算机和单片机(如MCS-51)都具有串行通信口,可以设计相应的串口通信程序,完成二者之间的数据通信任务。 实际工作中利用串口完成通信任务的时候非常之多。已有一些文章介绍串口编程的文章在计算机杂志上发表。但总的感觉说来不太
2014-09-01 19:20:50
888
原创 无名管道的亲缘关系进程的通信实例
#include #include #include #include #include #include #include //无名管道的实例pipe_r_w(){int pipe_fd[2];pid_t pid;char r_buf[100];char w_buf[4];char* p_wbuf;int r_num;int cmd;memset(r_buf,
2014-09-01 19:20:48
724
原创 用4个砝码称东西,且砝码只能放在…
<pre accuse="qContent" style="margin-top: 10px; margin-bottom: 0px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; white-space: pre-wrap; word-wrap: break-word; word-break:
2014-09-01 19:20:46
1074
原创 欢迎您在新浪博客安家
亲爱的朋友: 欢迎您在新浪博客安家,您的博客地址是:http://blog.sina.com.cn/u/3146864343 您可以用文字、图片、视频记录和展示最真实的自我,与网友交流,与线上好友聊天,还能通过手机发表博文和上传图片,随时随地记录心情和身边趣闻。 我们为您提供了丰富的炫酷模板来装点您在网上的家园,强大的音乐播放功能更能陪伴您的网络生活。准备好了吗?现在就开始精彩的
2014-09-01 19:20:44
396
原创 FIFO管道练习
先要在一个终端运行程序fifo2,然后在另外一个终端运行fifo1。运行fifo2后,fifo2把程序当前的时间存储到文件test之中,之后fifo1将从test文件中提取信息并显示。由于两个管道都把信息存储到test文件中,因此fifo管道要知道文件信息,就可以通信。fifo2.c#include #include #include #include #include
2014-09-01 19:20:41
612
原创 Linux的管道,一个写一个读
#include #include #include #include #include #include int main(){int fd[2];int fdin;char buf[PIPE_BUF];int pid,len;if(pipe(fd){perror("pipe error!");exit(1);}pid = fork();if(pid{
2014-09-01 19:20:39
797
原创 Linux信号量的测试
#include #include #include #include #include static int flag = 0; void alarmessage(int sig) { printf("This is alarm message.\n\r"); printf("Wait for 3 seconds.\n\r"); sleep(3);flag = 1;
2014-09-01 19:20:37
599
原创 Linux进程实验~
#include #include #include #include #include int main(){pid_t child;int status,a;//status表示子进程状态,a表示是否创建子进程printf("Do you want to create a new childprocess?(1:yes,2:no)");scanf("%d",&a);
2014-09-01 19:20:35
703
原创 Linux线程--生产者消费者模型
在生产者--消费者模型中,主程序分别启动了生产者线程和消费者线程,其中生产者线程不停的写入共享的循环缓冲区,二消费者线程这不停的从缓冲区中取出数据。在生产者写入缓冲区时,首先要获得互斥锁,并且判断缓冲区是否为满。也就是判断写指针+1后是否等于读指针,如果相等则进入等待状态,等候条件变量notfull发出信号,如果判断条件不等。则向缓冲区写一个整数,同时设置条件变量notempty,最后释放互斥
2014-09-01 19:20:33
1097
原创 归并排序温习~
#include #include voidprintf_array(int *array,int len){ int i=0; for(i =0;i { printf("%d ",*(array+i) ); //printf("%d ",array[i] ); } printf("\n");
2014-09-01 19:20:31
479
原创 快速排序温习
#include voidprintf_array(int *array,int len){ int i=0; for(i =0;i { printf("%d ",*(array+i) ); //printf("%d ",array[i] ); } printf("\n"); }
2014-09-01 19:20:28
418
原创 希尔排序温习~~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">#include voidprintf_array(int *array,int len){ int i=0; for(i =
2014-09-01 19:20:26
432
原创 冒泡排序的温习
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">#include voidprintf_array(int *array,int len){ int i=0; for(i =
2014-09-01 19:20:24
417
原创 插入排序的算法温习
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">#include voidprintf_array(int *array,int len){ int i=0; for(i =
2014-09-01 19:20:22
424
原创 选择排序算法重新温习
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">#include voidprintf_array(int *array,int len){ int i=0; for(i =
2014-09-01 19:20:20
443
原创 栈的练习,进制转换!
<fieldset style="color: rgb(19, 17, 11); font-size: 15px; border: 1px dashed rgb(0, 0, 0); width: 980px;margin: 0px 0px 15px; word-wrap: break-word; font-family: Verdana, Geneva, Arial, Helvetica, sa
2014-09-01 19:20:17
641
原创 【转载】PMOS,NMOS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><img title="PMOS,NMOS - ideality0214 - ideality0214的博客"src="http:/
2014-09-01 19:20:15
3815
原创 图的创建,有向图的创建,利用Prim…
///Graph.h#include "iostream"#include #include using namespace std;const int MaxVertices=20;const int MaxWeight=100;struct MinSpanTree{ int begin,end;// int length;//边的权值 };class Ad
2014-09-01 19:20:13
882
原创 搜索的学习和调试,包括深度搜索和…
<fieldset style="margin: 0px 0px 15px; padding: 10px; width: 980px; border: 1px dashed rgb(0, 0, 0); font-size: 15px; white-space: pre-wrap; word-wrap: break-word; color: rgb(19, 17, 11); font-family
2014-09-01 19:20:11
517
原创 【转载】【春节特刊】大小城市双城…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">文<span lang="EN-US" xml:lang="EN-US">/王远成(识局智库微信公共账号<span lang="EN-U
2014-09-01 19:20:09
1371
原创 蛇形数组输出的算法--ACM题目
#include#includeusing namespace std; int a[10][10]; //静态存储区分配空间int main(){ int i,j,n,num=0; cin>>n; int x=0,y=n-1; num=a[x][y]=1; memset(a,0,sizeof(a));////二维数组初始化为0,
2014-09-01 19:20:07
617
原创 双链表的学习的操作的实现,带源程…
#include #include typedef struct QNode{int data;struct QNode *next;}Qnode,*QueuePtr;typedef struct{QueuePtr front;//队列的头指针QueuePtr rear;//队列的尾指针}*LinkQueue;#define OK 1#define OVERFLOW
2014-09-01 19:20:05
432
原创 开灯问题的求解!
//n栈灯,第二个按下所有编号为2的倍数的灯,关掉的将被打开,开着将被关闭,一共k个人,最后那些灯开着//input 7 3//output 1 5 6 7#include#include#define MAXN 1000+10int a[MAXN];int main(){int i,j,k,n,first=1;scanf("%d %d",&n,&k);for(i=1;if
2014-09-01 19:20:02
521
原创 循环队列的数组实现!!
#include #define MAXSIZE 10typedef struct {int data[MAXSIZE];int front,rear;}*SeQueue;int SeQueueInit(SeQueue Q){Q->front=Q->rear=0;return 1;}void SeQueueIn(SeQueue Q,int x){if((Q->rear
2014-09-01 19:20:00
554
原创 用堆栈实现括号配对检测的程序
#include #include typedef struct{int *base;int *top;int stacksize;}*SqStack,myStack;#define STACK_INIT_SIZE 100#define STACKINCREMENT 10int InitStack(SqStack s){s->base=(int*)malloc(ST
2014-09-01 19:19:58
611
原创 递归的原理的验证程序!!
#include int count;void print(int w){int i;if(w!=0){print(w-1);count++;for(i=1;i{printf("%d,count-->%3d",count,w);}printf("\n");}}void main(){print(3);}<span class="ptcp"><
2014-09-01 19:19:56
729
原创 单链表的定位操作
单链表的定位操作<span style="line-height: 28px;">InputDescription建立一个长度为n的带头结点的单链表,查找该链表中数据原始值为item的结点,若找到,输出该结点在链表中的位序;没找到,输出0。(处理数据原始类型为整型,链表计算从1开始。)<span style="font-family: 宋体; mso-ascii-font-fam
2014-09-01 19:19:54
836
原创 单链表的删除
Description<span style="font-family: 宋体; font-size: 10.5pt; mso-ascii-font-family:"times="" new="" mso-hansi-font-family:="Times" new=""mso-font-kerning:="" mso-bidi-font-family:="Times" new=""ms
2014-09-01 19:19:52
765
原创 单链表的查找操作
单链表上查找算法的实现<span style="line-height: 28px;">InputDescription<span style="font-family: 宋体; font-size: 12pt; mso-ascii-font-family:"times="" new="" mso-hansi-font-family:="Times" new=""mso-font-k
2014-09-01 19:19:49
1542
原创 单链表的插入操作的实现---后插法…
单链表的插入操作的实现Description<p style="margin: 0cm 0cm 0pt; line-height: 150%; mso-pagination: widow-orphan;"><span style="line-height: 150%; font-family: 宋体; font-size: 12pt; mso-ascii-font-family:"
2014-09-01 19:19:47
3756
原创 单链表的删除操作的实现
Description<span style="font-family: 宋体; font-size: 12pt; mso-ascii-font-family:"times="" new="" mso-hansi-font-family:="Times" new=""mso-bidi-font-family:="Times" new="" mso-font-kerning:=""mso-
2014-09-01 19:19:45
1011
原创 递归方法求解汉诺塔!
Description(n阶Hanoi塔问题)假设有三个分别命名为A、B、C的塔座,在塔座A上插有n(n<20)个直径大小各不相同、依小到大编号为1,2,…,n的圆盘。现要求将A轴上的n个圆盘移至塔座C上并仍按同样顺序叠排,圆盘移动时必须遵循下列规则:1)每次只能移动一个圆盘;2)圆盘可以插在A、B、C中的任一塔座上;3)任何时刻都不能将一个较大的圆盘压在较小的圆盘之上。请通过编程来打
2014-09-01 19:19:43
699
原创 转的算法~~图的广度搜索!按照字典…
Input第一行为一个自然数n,表示顶点的个数,第二行为n个大写字母构成的字符串,表示顶点,接下来是为一个n*n大小的矩阵,表示图的邻接关系。数字为0表示不邻接,否则为相应的边的长度。最后一行为一个字符,表示要求进行广度优先搜索的起始顶点。Output用一行输出广度优先搜索结果,起始点为给定的顶点,各顶点之间用一个空格隔开。要求同一顶点的邻接点的访问顺序按“A”---“Z”的字典顺序。S
2014-09-01 19:19:41
447
原创 求水仙花数
#includeint main(){ int i,j,k,n,a,b,count;do{scanf("%d %d",&a,&b);count =0;if(a==0 && b == 0)break;else{for (n=a;n{i=n/100;j=(n-i*100)/10;k=n%10;if(n==i*i*i+j*j*j+k*k*k){printf("%d
2014-09-01 19:19:39
549
原创 转~素数求法
<div style="word-wrap: break-word; border-bottom-width: 0px; padding: 0px 0px 11px; color: rgb(86, 86, 86); font-family: 宋体, Arial; font-size: 12px; line-height: 12px;"> <a style="word-wrap: break-
2014-09-01 19:19:36
451
原创 求解三个数的最大的数,求最小的同…
#include#define maxabc(a,b) a>b?a:b// int maxabc(int a,int b)// {// int max;// max = (a>b)?a:b;// return max;// // }int main(){int a=10,b=20,c,max;scanf("%d %d%d",&a,&b,&c);max =maxa
2014-09-01 19:19:34
583
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人