- 博客(23)
- 收藏
- 关注
原创 计算字符串中sun的个数并以SUNXXXX的形式表示出来
DATAS SEGMENT;此处输入数据段代码 ENG DB 'Here is sun,sun,sun,sun,sun,...,$' DISP DB 'SUN'DAT DB '0000' , 0DH, 0AH, '$' KEYWORD DB 'sun'DATAS ENDSSTACKS SEGMENT DW 100 DUP(?) ;此处输入堆栈段代码ST
2016-03-30 23:52:37 814 1
原创 求出data为首地址的100D字数组中的最小偶数,并把它存放在AX中,目前只能做出无符号数,有待修改
DATAS SEGMENT;此处输入数据段代码 ARRAY DW 4,5,6,7,8,9,3,6,1,10,34,12,45,58,6,32,15,17,20,'$'Z DB 100,10DATAS ENDSSTACKS SEGMENT;此处输入堆栈段代码 DW 100 DUP(?)STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS
2016-03-30 23:42:05 4993 1
原创 编写将一个包含有20个数据的数组M分成两个数组,正整数数组P和负数数组N ,分别把这两个数组中的数据的个数显示出来
DATAS SEGMENT;此处输入数据段代码 MARRAY DW 1,2,3,4,5,-6,-7,-8,-9,-10,-11,12,13,14,-15,-16,-17,18,'$'PARRAY DW 10 DUP(?)NARRAY DW 10 DUP(?)Z DB 10 DATAS ENDSSTACKS SEGMENT ;此处输入堆栈段代码 DW 100 DUP
2016-03-30 21:08:19 18599
原创 从键盘输入两个字符串,如果相等,输出match,否则输出no match。
DATAS SEGMENT ;此处输入数据段代码 INFO1 DB 0DH,0AH,'INPUT STRING:$'INFO2 DB 0DH,0AH,'MATCH! $'INFO3 DB 0DH,0AH,'NO MATCH! $'BUFA DB 21 DB ? DB 20 DUP(0)BUFB DB 21
2016-03-30 18:47:50 2484
原创 c语言:顺序栈的应用(二) 判断回文数
#include#include#define STACK_INIT_SIZE 100#define STACK_INCREMENT 10using namespace std;typedef struct Stack //结构体定义{ int *elem; //数据域int top; //顺序栈栈顶int stacksize;
2016-03-30 13:28:46 8741
原创 顺序栈S中有2n个元素,从栈顶到栈底的元素依次为a2n、a2n-1、…、a1。试设计一个算法:通过一个循环队列重新排列该栈中的元素,使得从栈顶到栈底的元素先偶数,后奇数
#include#include#define STACK_INIT_SIZE 100#define QUEUE_MAX_SIZE 100#define STACK_INCREMENT 10using namespace std;typedef struct Stack //结构体定义{ int *elem; //数据域 int top; //顺序栈栈
2016-03-30 13:15:56 13402 12
原创 c语言:链队列的实现
// 链队列及其操作实现.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include#include#includeusing namespace std;typedef struct QNode{ int data; struct QNode *next;}QNode, *Queueptr;typedef struct{ Qu
2016-03-28 21:52:39 1253
原创 c语言:循环队列的实现
#include#include#include#define QUEUE_MAX_SIZE 100using namespace std;typedef struct Sqqueue{ int *data; int front; int rear;}Sqqueue;//函数声明void Error(char *s);
2016-03-28 20:04:46 1032
原创 c语言:链栈的实现
#include#include#include#define LEN sizeof(struct LNode)using namespace std;typedef struct LNode{ int data; struct LNode *next;}LNode;typedef struct LinkStack{ LNode *top;}LinkStack;//函数
2016-03-28 17:17:05 881
原创 c语言:顺序栈的应用-进制转换
#include#include#define STACK_INIT_SIZE 100#define STACK_INCREMENT 10using namespace std;typedef struct Stack //结构体定义{ int *elem; //数据域 int top; //顺序栈栈顶 int stacksize; //顺序栈当
2016-03-27 23:25:23 1908
原创 c语言:顺序栈的实现
#include#include#include#define STACK_INIT_SIZE 100#define STACK_INCREMENT 10using namespace std;typedef struct Stack //结构体定义{ int *elem; //数据域 int top; //顺序栈栈顶 int stacksize;
2016-03-27 22:12:11 3705
原创 c语言:双向循环链表的实现
// 双向循环链表实现.cpp : 定义控制台应用程序的入口点。#include#include#include#define LEN sizeof(struct DSCriculist)using namespace std;typedef struct DSCriculist //定义结构体{ int data; //数据域 struct
2016-03-26 11:34:28 1407
原创 c语言:单向循环链表的实现
// 单循环链表的实现.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include#include#include#define LEN sizeof(struct SCriculist)using namespace std;typedef struct SCriculist //定义结构体{ int data;
2016-03-26 02:05:07 3174 1
原创 C语言:单链表实现(二) 就地逆置,就地归并
#include#include#include#define LEN sizeof(struct Nodelist)using namespace std;typedef struct Nodelist{ int data;; struct Nodelist *next;}Nodelist;//函数声明void Error(char *s);
2016-03-25 19:12:00 2038
原创 c语言:双向链表的实现
#include#include#include#define LEN sizeof(struct DNodelist)using namespace std;typedef struct DNodelist //定义结构体{ int data; //结点数据域 struct DNodelist *prior;//结点前向指针 struct DN
2016-03-25 15:25:40 676
原创 汇编语言:三个数比较大小,输出最小的那个数。
DATAS SEGMENT;此处输入数据段代码 X DW 89Y DW -78Z DW 98W DB 100,10FLAG DW 0DATAS ENDSSTACKS SEGMENT;此处输入堆栈段代码 DW 100 DUP(?)STACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART:
2016-03-25 01:20:20 15176
原创 c语言:顺序表的实现(三)将元素e插入到一个递减有序表中,不改变顺序表的递减有序性。
#include#include#define LIST_INIT_SIZE 100using namespace std;struct Node{ int *elem; int Length; int Listsize;};void Error(char *s) //错误处理函数{ cout << s << endl; exit(1);}void InitNo
2016-03-22 23:47:23 1864
原创 c语言:顺序表的实现(二 ) 就地逆置,有序合并,大小调整。
#include#include#define LIST_INIT_SIZE 100using namespace std;struct Node{ int *elem; int Length; int Listsize;};void Error(char *s) //错误处理函数{ cout << s << endl; exit(1);}void InitNo
2016-03-22 23:31:20 2263
原创 c语言:顺序表的实现(一) 创建,插入,删除,查找,输出等基本操作实现
#include#include#define LIST_INIT_SIZE 100#define LIST_INCREMENT 10using namespace std;struct Sqlist{ long *elem, *newlist; int Length; int listsize;};void Error(char *s){ cout << s << end
2016-03-22 00:00:49 29086 2
原创 c语言:单链表的实现(一) 创建,插入,删除,查找
#include#include#include#define NULL 0#define LEN sizeof(struct Student)using namespace std;typedef struct Student{ int length; int num; struct Student *next;}Student; typedef Student *Lin
2016-03-21 23:56:37 6065 1
原创 c语言:多项式相加的实现
#include#include#include#define NULL 0#define LEN sizeof(struct ADD)using namespace std;struct ADD //定义结构体{ float xishu; //数据域 int zhishu; struct ADD *next; //指针域}; voi
2016-03-21 23:51:01 3892
原创 c语言:约瑟夫环的实现
#include#include#include#define LEN sizeof(struct Node)using namespace std;typedef struct Node{ int data; struct Node *next;}Node;typedef Node *linklist;void CreatNode (linklist &L,int n)
2016-03-20 14:50:01 613
原创 求链表结点的阶乘和
本题要求实现一个函数,求单链表L结点的阶乘和。这里默认所有结点的值非负,且题目保证结果在int范围内。函数接口定义:int FactorialSum( List L );其中单链表List的定义如下:typedef struct Node *PtrToNode;struct Node { int Data; /* 存储结点数据 */ PtrToNode Next; /* 指向下
2016-03-08 22:10:04 514
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人