2012年10月19日
摘要: 追问关于点的显示类型,比如可以用“*”,“.”,还有什么形状进行点的显示吗?回答'+' 'o' 'x' 's' 'd' 'h'加号 圆圈 交叉符号 方格 菱形 六边形plot3(a(1),a(2),a(3),'r*','markersize',20)%%%调整点大小和颜色 阅读全文
posted @ 2012-10-19 10:51 C's 阅读(111) 评论(0) 推荐(0) 编辑
摘要: s=0;for i=1:100 s=s+i y(i)=sendplot(y(1:100),'.') 阅读全文
posted @ 2012-10-19 10:29 C's 阅读(176) 评论(0) 推荐(0) 编辑
  2012年5月25日
摘要: View Code 图的邻接距阵与邻接表的转换#include <stdio.h>#include <malloc.h>#define INF 32767 //INF表示∞typedef int InfoType;typedef int Vertex;#define MAXV 50 //最大顶点个数//以下定义邻接矩阵类型typedef struct { int nunber; //顶点编号InfoType info; //顶点其他信息} VertexType; //顶点类型typedef struct //图的定义{ int edg... 阅读全文
posted @ 2012-05-25 11:06 C's 阅读(738) 评论(0) 推荐(0) 编辑
  2012年5月18日
摘要: #include<stdio.h>#include<stdlib.h>typedef struct bitree{char data;struct bitree *lchild,*rchild;}bitree;int main(){bitree* createbitree(int i,int *j,bitree *t,char *ch);void lordertraverse(bitree *t);int i,*j,a;char *ch;bitree *t;t=NULL;a=1;j=&a;ch=(char *)malloc(2*sizeof(char));i=1 阅读全文
posted @ 2012-05-18 10:27 C's 阅读(224) 评论(0) 推荐(0) 编辑
  2012年5月11日
摘要: #include<stdio.h>typedef int ElemType;typedef struct node //定义二叉树结点结构{ ElemType data; struct node *lchild; struct node *rchild;}BTNode;typedef struct //1.定义双亲结构储存类型{ ElemType data; int parent; //指向双亲的位置}ptree[MaxSize];typedef struct node ... 阅读全文
posted @ 2012-05-11 11:24 C's 阅读(218) 评论(0) 推荐(0) 编辑
  2012年4月27日
摘要: View Code #include<stdio.h>#include<stdlib.h>const int N=20;int q[N];int cont=0;void print(int n){ cont++; int i; printf("NO.%d:",cont); for(i=1;i<=n;i++) printf("%d",q[i]); printf("\n");}int find(int i,int k){ int j; j=1; while(j<k) { if((q[j]==i)||(a 阅读全文
posted @ 2012-04-27 11:21 C's 阅读(244) 评论(0) 推荐(0) 编辑
摘要: View Code #include<stdio.h>#include<stdlib.h>const int N=20;int q[N];int cont=0;void print(int n){ cont++; int i; printf("NO.%d:",cont); for(i=1;i<=n;i++) printf("%d",q[i]); printf("\n");}int find(int i,int k){ int j; j=1; while(j<k) { if((q[j]==i)||(a 阅读全文
posted @ 2012-04-27 10:25 C's 阅读(198) 评论(0) 推荐(0) 编辑
  2012年4月13日
摘要: #include<stdio.h>#define max 100struct{int i,j;int pre;}qu[max];int front=-1,rear=-1;int mgpath(int xi,int yi,int xe,int ye)//[xe,ye]->[xi,yx]{int i,j,find=0,di;rear++;qu[rear].i=xi;qu[rear].j=yi;qu[rear].pre=-1;mg[1][1]=-1;while(front<=rear &&!find) 阅读全文
posted @ 2012-04-13 11:32 C's 阅读(185) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int c[200][200]={0},i,j,x,a=1,k; printf("please enter the line you need:"); scanf("%d",&x); for(i=0;i<x;i++) { for(j=0;j<=i;j++) { if(i==j||j==0)c[i][j]=1; else c[i][j]=c[i-1][j-1]+c[i-1][j]; } } for(i=0;i<x... 阅读全文
posted @ 2012-04-13 10:09 C's 阅读(184) 评论(0) 推荐(0) 编辑
  2012年3月30日
摘要: 1.c#include<stdio.h>#define size 100struct{ char ch; int pri;}lpri[]={{'=',0},{'(',1},{'*',5},{'/',5},{'+',3},{'-',3},{')',6}},rpri[]={{'=',0},{'(',6},{'*',4},{'/',4},{'+',2},{'-',2},{') 阅读全文
posted @ 2012-03-30 11:06 C's 阅读(348) 评论(0) 推荐(0) 编辑