会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
闲来敲敲代码......
Click me!
有容乃大:好读书不求甚解
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
下一页
2014年5月8日
Thread create 创建进程
摘要: 1 #include "windows.h" 2 #include "iostream" 3 #include "stdio.h" 4 5 void StartClone(int nCloneID){ 6 TCHAR szFilename[MAX_PATH]; 7 GetModu...
阅读全文
posted @ 2014-05-08 07:49 森语音
阅读(644)
评论(0)
推荐(0)
2014年5月4日
Linux内核之旅 链表实现
摘要: 1 #include "stdio.h" 2 #include "stdlib.h" 3 4 struct list_head{ 5 struct list_head *prev; 6 struct list_head *next; 7 }; 8 9 struct task{1...
阅读全文
posted @ 2014-05-04 20:46 森语音
阅读(170)
评论(0)
推荐(0)
2014年4月24日
Linux内核之旅 List_entry()
摘要: #include "iostream"#define List_entry(type,member)\(type *)((char*)(&member)-(unsigned long)(&(((type*)0)->data)) )using namespace std;struct list_hea...
阅读全文
posted @ 2014-04-24 09:16 森语音
阅读(411)
评论(0)
推荐(0)
2014年4月16日
希尔排序
摘要: #include "iostream"using namespace std;void XierPaixu(int a[],int size,int length){ for(int i=size;i>0;i=i/2){ for(int j=i;j=0&&a[k]>key;k-=...
阅读全文
posted @ 2014-04-16 11:02 森语音
阅读(216)
评论(1)
推荐(0)
2013年10月31日
华为2013校园招聘上机笔试题 ---2 字符串处理转换
摘要: 2 字符串处理转换问题描述: 在给定字符串中找出单词( “单词”由大写字母和小写字母字符构成,其他非字母字符视为单词的间隔,如空格、问号、数字等等;另外单个字母不算单词);找到单词后,按照长度进行降序排序,(排序时如果长度相同,则按出现的顺序进行排列),然后输出到一个新的字符串中;如果某个单词重复出现多次,则只输出一次;如果整个输入的字符串中没有找到单词,请输出空串。输出的单词之间使用一个“空格”隔开,最后一个单词后不加空格。要求实现函数:void my_word(charinput[], char output[])【输入】 char input[], 输入的字符串【输出】 char ou.
阅读全文
posted @ 2013-10-31 17:43 森语音
阅读(921)
评论(0)
推荐(0)
2013年7月19日
编程求凸包点集
摘要: #include "stdafx.h"#include #include using namespace std;class point{public: double x; double y; double z; bool operator ==(point& p){ if(x=p.x&&y==p.y&&z==p.z) return true; else return false; } double angle;};class line{public: line(point p1,...
阅读全文
posted @ 2013-07-19 17:53 森语音
阅读(271)
评论(0)
推荐(0)
2013年5月18日
由二叉树中序和先序遍历求二叉树的结构
摘要: // 二叉树.cpp : 定义控制台应用程序的入口点。//#include "stdio.h"char A[10];char B[10];//int length;void input(){ printf("二叉树中序遍历:"); gets(A); printf("二叉树先序遍历:"); gets(B);}int position(int m){ int i; for(i=0;i<10;i++) if(B[m]==A[i]) return i; return -1;}void output(int i,int j,i...
阅读全文
posted @ 2013-05-18 13:59 森语音
阅读(290)
评论(0)
推荐(0)
2013年5月1日
用类模板实现对任何类型的数据进行堆栈进行存取操作。
摘要: #include "iostream"using namespace std;template <class T>class stack{public: stack(){ L=NULL; } void push(T x); T pop();private: struct Node{ T data; Node *next; } *L;};template <class T>void stack<T>::push(T x){ Node *p=(Node*)malloc(sizeof(Node)); p->da...
阅读全文
posted @ 2013-05-01 22:15 森语音
阅读(265)
评论(0)
推荐(0)
2013年3月11日
10.1-4重写ENqUEUE和DEQUEUE,使之能处理队列的下溢和上溢。
摘要: #include "iostream"using namespace std;typedef struct{ int tail; int head; int q[7];}QUEUE;//队列数据结构定义bool QUEUE_EMPTY(QUEUE &Q){ if(Q.tail==Q.head) return true; else return false;}//判断队列是否已空bool QUEUE_FULL(QUEUE &Q){ if(Q.tail==6&&Q.head==1||Q.tail+1==Q.head) ...
阅读全文
posted @ 2013-03-11 15:26 森语音
阅读(1004)
评论(0)
推荐(0)
2013年3月10日
10.1-2 说明如何用一个数组A[1..n]来实现两个栈,使得两个栈中的元素总数不到n时,两者都不会发生上溢,注意PUSH和POP操作的时间应为O(1)。
摘要: #include "iostream"#include "string"using namespace std;int A[9]={-1,1,2,3,4,5,6,7,8};int top_s1=0,top_s2=9;bool PUSH(string s,int x){ if(top_s1+1==top_s2) return false; else{ if(s=="s1"){ top_s1++; A[top_s1]=x; } else{ top_s2--; ...
阅读全文
posted @ 2013-03-10 11:00 森语音
阅读(1505)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页