摘要: //#include "stdx.h"#include "Menu.h"#include "fx.h"#include <stdlib.h>#include <iostream.h>int main(){ Menu MainMenu[11]; //主菜单 MainMenu[1].Name="运动会分数统计"; //菜单项赋值 MainMenu[2].Name="一元多项式计算"; MainMenu[3].Name="二叉树的遍历"; MainMenu[ 阅读全文
posted @ 2006-02-09 16:24 陕北蜂农 阅读(264) 评论(0) 推荐(0)
摘要: //运动会分数统计 //////////时间:2005-7-4//程序: 张建波#include <iostream.h>#include <string.h>#include "menu.h"#include "Key.h"typedef struct xm_table{ int item;// 项目编号 char name[20]; int count; //该项目得分人的数量}XM_TABLE;struct STUDENT{ char name[20]; //姓名 int score; //得分成绩 int range; / 阅读全文
posted @ 2006-02-09 16:23 陕北蜂农 阅读(609) 评论(0) 推荐(0)
摘要: //文章编辑//时间: 2005-7-6//程序:张建波#include <iostream.h>#include <string.h>#include <stdio.h>#include "Menu.h"#include "key.h"#include <stdlib.h>typedef struct line{ //char data[80]; char *data; //字符串指针需要时 动态分配内存 struct line *next;}LINE;void CreateTXT(LINE * & 阅读全文
posted @ 2006-02-09 16:22 陕北蜂农 阅读(288) 评论(0) 推荐(0)
摘要: //一元多项式加减程序//程序:张建波//时间:2005/7/12 PM:20-08//功能:// 1:可以计算 1+2+3-1+2-5+6+3 (加减法均可)// 2: 可以计算 2x+3x+5x-x^2+x^3+4x^7+9// 3: 可以进行组合计算 A=1+2+x+x^2 B=x+x^2 A+B=3+2x+2x^2//注意:除指数不能为 负!!其余都可以输入负数#include <iostream.h>#include <string.h>#include <math.h>#include "Menu.h"#include &qu 阅读全文
posted @ 2006-02-09 16:22 陕北蜂农 阅读(423) 评论(0) 推荐(0)
摘要: 一堆猴子都有编号,编号是1,2,3 ...m ,这群猴子(m个)按照1-m的顺序围坐一圈,从第1开始数,每数到第N个,该猴子就要离开此圈,这样依次下来,直到圈中只剩下最后一只猴子,则该猴子为大王。要求:输入数据:输入m,n ,m,n 为整数,n<m输出形式:提示按照m个猴子,数n 个数的方法,输出为大王的猴子是几号 ,建立一个函数来实现此功能。//猴子选王//程序:张建波//时间:05/07/05#include <iostream.h>typedef struct Node{ int data; struct Node *next;}NODE;int _f6_main() 阅读全文
posted @ 2006-02-09 16:21 陕北蜂农 阅读(238) 评论(0) 推荐(0)
摘要: //排序//程序:张建波//时间:05/07/10 Am 2:50#include <iostream.h>#include <stdlib.h>#include "menu.h"#include "key.h"int RandomNum(int *RandArray,int N); //随机生成数据void OutPutNum(int *p,int N); //输出测试数据void BubbleSort(int *p,int N,int SortType); //冒泡排序void InsertSort(int *p,int N, 阅读全文
posted @ 2006-02-09 16:20 陕北蜂农 阅读(174) 评论(0) 推荐(0)
摘要: //翻牌游戏//程序:张建波//时间:2005/07/06#include <iostream.h>#include <iomanip.h>void load_pai(); //向数组中写入 牌 序列void Show_Pai(); //向屏幕打印 牌void f_pai(); //翻牌void Show_FP_Pai(int i); //向屏幕输出中间翻牌的过程 状态int pai[53]; // 牌 int _f7_main(){ //函数入口,通过主函数调用 load_pai(); //加载牌序号 f_pai(); //开始翻牌 Show_Pai(); //向屏幕 阅读全文
posted @ 2006-02-09 16:19 陕北蜂农 阅读(212) 评论(0) 推荐(0)
摘要: //二叉树//时间: 05/07/08//程序: 张建波//功能:输入二叉树,完成前序、中序、后序、层序遍历#include <iostream.h>#include "Menu.h"#include "key.h"struct tree { int data; // 节点数据 struct tree *left; // 左子树 struct tree *right; // 右子树};struct MT{ int data[100]; //保存每层元素 int n; //每层元素的个数}; //层序遍历保存二叉树的结点struct MT mt 阅读全文
posted @ 2006-02-09 16:18 陕北蜂农 阅读(267) 评论(0) 推荐(0)
摘要: ////joseph环//时间:05/07/04//程序:张建波//输入 n=7 // 3,1,7,2,4,7,4 //输出6 7 4 1 5 3 2#include <iostream.h>#include "key.h"typedef struct person{ int pwd; //密码 int num; //人数 struct person *next; //指向结构体的指针}PERSON; void OutPut(int *a,int n);//输出结果int CreatPersonList(PERSON *head);// 创建一张链表int Fx 阅读全文
posted @ 2006-02-09 16:16 陕北蜂农 阅读(367) 评论(0) 推荐(0)
摘要: % newton.m%x=newton(inline('x^3-2*x-5'),inline('3*x^2-2'),0.5,100,1e-6)%function [y,z]=newton(fv,df,x0,n,tol)function [y]=newton(fv,df,x0,tol)x(1)=x0; b=1; k=1;while or(k==1,abs(b)>tol*abs(x(k))) x(k+1)=x(k)-feval(fv,x(k))/feval(df,x(k)); b=x(k+1)-x(k); k=k+1; %if(k>n) % error( 阅读全文
posted @ 2006-02-09 16:14 陕北蜂农 阅读(242) 评论(0) 推荐(0)