自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(2)
  • 资源 (2)
  • 收藏
  • 关注

转载 贪食蛇程序

#define N 200#include #include #include #define LEFT 0x4b00#define RIGHT 0x4d00#define DOWN 0x5000#define UP 0x4800#define ESC 0x011bint i,key;int score=0;/*得分*/int gamespeed=500

2014-05-03 21:52:53 646

原创 Perl四则运算

########################################just use for practice########################################!/usr/bin/perl #use warning#use diagnostics; #use diagnositc#use warnings; #use warni

2013-07-13 20:13:51 2111

java 计算器程序

//版本:2.0.1 //作者:Linn //日期:2010.12.27 //说明:bug不较多,不爱弄了,先交作业再说,以后再改,有疑问请联系作者 //学习java,实验老师要求做的一个计算器,感觉自己写的还能让人接受吧,就发上来,大家都看看呗。用得着的就拿去

2010-12-30

排序二叉树程序,大学生可以用交作业

#include<stdio.h> #include<malloc.h> struct tree { int num; struct tree *Lchild; struct tree *Rchild; }*head; struct tree *insert(struct tree **p0,int x) /*就改了这个参数,原因是一级指针不能返回申请的内存,因为参数副本问题*/ { struct tree *p1; /*建立一个排序二叉树*/ if(*p0==NULL) { p1=(struct tree *)malloc(sizeof(struct tree)); p1->num=x;p1->Lchild=NULL;p1->Rchild=NULL; *p0=p1; } else { if(x<(*p0)->num) { insert(&((*p0)->Lchild),x); } else if(x>(*p0)->num) { insert(&((*p0)->Rchild),x); } }return(head); } struct tree *DLR(struct tree *p0) /*先序遍历*/ { if(p0!=NULL) { printf("%3d",p0->num); DLR(p0->Lchild); DLR(p0->Rchild); }return NULL; } struct tree *LDR(struct tree *p0) /*中序遍历,也即是顺序输出*/ { if(p0!=NULL) { LDR(p0->Lchild); printf("%3d",p0->num); LDR(p0->Rchild); }return NULL; } struct tree *LRD(struct tree *p0) /*后序遍历*/ { if(p0!=NULL) { LRD(p0->Lchild); LRD(p0->Rchild); printf("%3d",p0->num); } } void main() { int i,x; head=NULL; for(i=1;i<=5;i++) { printf("please input the %d number:",i); /*不能输入相同数据,小bug*/ scanf("%d",&x); insert(&head,x); } printf("the preorder traversal is:");DLR(head);printf("\n"); printf("the inorder traversal is:");LDR(head);printf("\n"); printf("the postorder traversal is:");LRD(head);printf("\n"); getchar(); getchar(); }

2009-09-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除