摘要:
1 #include "windows.h" 2 #include "iostream" 3 #include "stdio.h" 4 5 void StartClone(int nCloneID){ 6 TCHAR szFilename[MAX_PATH]; 7 GetModu... 阅读全文
摘要:
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... 阅读全文
摘要:
#include "iostream"#define List_entry(type,member)\(type *)((char*)(&member)-(unsigned long)(&(((type*)0)->data)) )using namespace std;struct list_hea... 阅读全文
摘要:
#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-=... 阅读全文
摘要:
2 字符串处理转换问题描述: 在给定字符串中找出单词( “单词”由大写字母和小写字母字符构成,其他非字母字符视为单词的间隔,如空格、问号、数字等等;另外单个字母不算单词);找到单词后,按照长度进行降序排序,(排序时如果长度相同,则按出现的顺序进行排列),然后输出到一个新的字符串中;如果某个单词重复出现多次,则只输出一次;如果整个输入的字符串中没有找到单词,请输出空串。输出的单词之间使用一个“空格”隔开,最后一个单词后不加空格。要求实现函数:void my_word(charinput[], char output[])【输入】 char input[], 输入的字符串【输出】 char ou. 阅读全文
摘要:
#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,... 阅读全文
摘要:
// 二叉树.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... 阅读全文
摘要:
#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... 阅读全文
摘要:
#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) ... 阅读全文
摘要:
#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--; ... 阅读全文