2012年12月7日

摘要: //插入一个元素#include#include#defineLIST_INIT_SIZE100#defineLISTINCREMENT10#defineOVERFLOW-2#defineERROR0#defineOK1typedefintStatus;usingnamespacestd;typedefstruct{char*elem;intlenght;intlistsize;}SqList;StatusInitList_Sq(SqList&L){L.elem=(char*)malloc(LIST_INIT_SIZE*sizeof(char));if(!L.elem)exit(OVE 阅读全文
posted @ 2012-12-07 22:49 木本 阅读(488) 评论(0) 推荐(0) 编辑
摘要: //删除一个元素#include#include#defineLIST_INIT_SIZE100#defineLISTINCREMENT10#defineOVERFLOW-2#defineERROR0#defineOK1typedefintStatus;usingnamespacestd;typedefstruct{char*elem;intlenght;intlistsize;}SqList;StatusInitList_Sq(SqList&L){L.elem=(char*)malloc(LIST_INIT_SIZE*sizeof(char));if(!L.elem)exit(OVE 阅读全文
posted @ 2012-12-07 22:47 木本 阅读(275) 评论(0) 推荐(0) 编辑
摘要: //输入字符串查看括号是否匹配···#include#include#include#define OK 1#define ERROR 0#define STACK_INIT_SIZE 100#define STACKINCREMENT 10using namespace std;typedef struct{int *base;int *top;int stracksize;}SqStack;int InitStack(SqStack &S){S.base=(int *)malloc(STACK_INIT_SIZE*sizeof(int));if(!S. 阅读全文
posted @ 2012-12-07 22:46 木本 阅读(224) 评论(0) 推荐(0) 编辑
摘要: //掷骰子···#include#include#include#includeusing namespace std;int Great();int n1=0,n2=0;int main(){char c='Y';while(c=='Y'){ Great(); cout<<"是否想继续进行游戏???Y or N :";cin>>c; system("cls");}cout<<"游戏者赢得次数:"<<n1<<end 阅读全文
posted @ 2012-12-07 22:45 木本 阅读(240) 评论(0) 推荐(0) 编辑
摘要: #include#include#defineOK1#defineERROR-1#defineSTACK_INIT_SIZE100#defineSTACKINCREMENT10usingnamespacestd;typedefstruct{int*base;int*top;intstracksize;}SqStack;intInitStack(SqStack&S){S.base=(int*)malloc(STACK_INIT_SIZE*sizeof(int));if(!S.base)exit(ERROR);S.top=S.base;S.stracksize=STACK_INIT_SIZ 阅读全文
posted @ 2012-12-07 22:43 木本 阅读(162) 评论(0) 推荐(0) 编辑
摘要: packagelyt;importjava.util.*;publicclassLyt1{// Scannerinput=newScanner(System.in);publicstaticvoidmain(String[]args){//TODOAuto-generatedmethodstubint[][]time={{1,2,3,5,7,3,5},{2,6,3,5,8,1,2},{1,3,7,6,3,9,6},{4,4,4,3,7,8,1}, {1,5,4,2,6,3,7},{1,5,3,2,6,8,4},{1,3,4,7,1,1,5},{5,5,5,2,1,1,2}};int[]sum= 阅读全文
posted @ 2012-12-07 22:41 木本 阅读(122) 评论(0) 推荐(0) 编辑
摘要: package jjj;import java.util.Scanner;public class lyt {public static void main(String[] args) {// TODO Auto-generated method stubScanner input=new Scanner(System.in);int [][]Arr=new int[100][100];int n1,n2;System.out.print("请输入矩阵的行数和列数:"); n1=input.nextInt();n2=input.nextInt(); Input(Arr,n 阅读全文
posted @ 2012-12-07 22:39 木本 阅读(243) 评论(0) 推荐(0) 编辑
摘要: //输入字符串查看括号是否匹配···#include#include#include#define OK 1#define ERROR 0#define STACK_INIT_SIZE 100#define STACKINCREMENT 10using namespace std;typedef struct{int *base;int *top;int stracksize;}SqStack;int InitStack(SqStack &S){S.base=(int *)malloc(STACK_INIT_SIZE*sizeof(int));if(!S. 阅读全文
posted @ 2012-12-07 22:37 木本 阅读(161) 评论(0) 推荐(0) 编辑
摘要: #include#include "lyt0.h"int main(){BiTree T;cout<<"输入一串字符以'.'表示结束;"<<endl;CreateBiTree(T);cout<<"先序遍历:"<<endl;PreOrderTraverse(T,PrintElement);cout<<endl;return 0;}//lyt0.h#includeusing namespace std;#define OVERFLOW -2#define OK 1 阅读全文
posted @ 2012-12-07 22:35 木本 阅读(108) 评论(0) 推荐(0) 编辑
摘要: //输入字符串查看括号是否匹配···#include#include#include#define OK 1#define ERROR 0#define STACK_INIT_SIZE 100#define STACKINCREMENT 10using namespace std;typedef struct{int *base;int *top;int stracksize;}SqStack;int InitStack(SqStack &S){S.base=(int *)malloc(STACK_INIT_SIZE*sizeof(int));if(!S. 阅读全文
posted @ 2012-12-07 22:33 木本 阅读(203) 评论(0) 推荐(0) 编辑

导航