CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - INT 1
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
assembly language
SCSI-ASPI
ELanguage
Disk Tools
Speech/Voice recognition/combine
Editor
Anti-virus
MultiLanguage
MPI
source in ebook
Delphi VCL
OS Develop
MiddleWare
MacOS develop
LabView
e-language
python
Search - INT 1 - List
[
Other
]
CSorter
DL : 0
一种新的排序类;支持int,double,cstring3种数据类型;要对数据结构排序也是可以的;-a new order; Support int, double, cstring3 types of data types; To order data structure can be;
Date
: 2008-10-13
Size
: 2.17kb
User
:
赵宏俊
[
Other
]
haokan
DL : 0
试扩充深度优先搜索算法,在遍历图的过程中建立生成森林的左子女-右兄弟链表。算法的首部为 void Graph::DFS ( const int v, int visited [ ], TreeNode<int> * t ) 其中,指针t指向生成森林上具有图顶点v信息的根结点。(提示:在继续按深度方向从根v的某一未访问过的邻接顶点w向下遍历之前,建立子女结点。但需要判断是作为根的第一个子女还是作为其子女的右兄弟链入生成树。) -try to expand the depth-first search algorithm, the traverse of the process to establish the forest generation of children left-right List brothers. The first algorithm to void Graph : : DFS (const int v, int visited [], TreeNode
Date
: 2008-10-13
Size
: 1.2kb
User
:
dfssd
[
Other
]
NumberToChar
DL : 0
将数字转换成中文习惯读法,只支持整数,其中的NumToChar(int num)为具体实现这一算法-will be converted into the Chinese habit of reading, only supports integer, the NumToChar (int num) for the concrete realization of this algorithm
Date
: 2008-10-13
Size
: 26.23kb
User
:
张团周
[
Other
]
DB05
DL : 0
矩阵运算的算法 用Type类数组创建矩阵对象 matrix(int rows,int cols) //创建矩阵,值为0 matrix(int n) //创建单位阵 matrix(const matrix &) //拷贝构造函数 BOOL Ismatrixf(){ return (rows==cols) } //判断矩阵是否为方阵 modifyrowscols(int rows,int cols) //修改矩阵的行列数 ~matrix() {delete []elems } //析构函数 -matrix algorithm with Type category created matrix array object matrix (int rows, int cols) / / create matrix, value of 0 matrix (int n) / / create units matrix array (const matrix
Date
: 2008-10-13
Size
: 50.37kb
User
:
跑过的云
[
Other
]
test_int
DL : 0
int 的高低字节-int byte
Date
: 2008-10-13
Size
: 836byte
User
:
代代
[
Other
]
factorial
DL : 0
利用数组实现大数阶乘,初始数组设为long int,长度35000,可以实现8000以内任意数的阶乘,可以修改数组长度,改变所计算数的范围。用c实现,vc6.0环境下测试通过
Date
: 2008-10-13
Size
: 1.2kb
User
:
tumbler
[
Other
]
PostForum
DL : 0
/*** *** *** *** **/ /* 灌水机 源代码 */ /* PostForum.cpp */ /********************************************/ #include #include #include <winsock.h> main(int argc,char *argv[]){ char buff[4096] SOCKET sock SOCKADDR_IN addr
Date
: 2008-10-13
Size
: 1.14kb
User
:
liuchao
[
Other
]
JosephusRing
DL : 0
约瑟夫环问题(Josephus),用户输入M,N值,从1至N开始顺序循环数数,每数到M输出该数值,直至全部输出。由于当某个人退出圆圈后,报数的工作要从下一个人开始继续,剩下的人仍然是围成一个圆圈的,可以使用循环表,由于退出圆圈的工作对应着表中结点的删除操作,对于这种删除操作频繁的情况,选用效率较高的链表结构,为了程序指针每一次都指向一个具体的代表一个人的结点而不需要判断,链表不带头结点。所以,对于所有人围成的圆圈所对应的数据结构采用一个不带头结点的循环链表来描述。设头指针为p,并根据具体情况移动。 为了记录退出的人的先后顺序,采用一个顺序表进行存储。程序结束后再输出依次退出的人的编号顺序。由于只记录各个结点的number值就可以,所以定义一个整型一维数组。如:int quit[n] n为一个根据实际问题定义的一个足够大的整数。
Date
: 2008-10-13
Size
: 1.74kb
User
:
金瑶
[
Other
]
baseCla
DL : 0
利用虚函数手段,按照三种不同的数据存储方式及其处理方法来实现如下的所谓“反序输出问题”:从键盘输入n 个int 型数据先存储起来(具体n 值由用户从键盘输入),而后再按照与输入相反的顺序将这些数据显示在屏幕上。具体地说,可通过在基类baseCla 及其派生类method1Cla、method2Cla 和method3Cla中说明如下的同一个虚函数“virtual void reverseout() ”,来实现所述问题的三种不同处理方法。例如,可设计并使用已经在第四章和第六章的实践题中所使用的数据存储结构以及处理方法:(1)使用大小为100 的常界数组存放数据;(2)通过new 生成大小恰为n 的动态数组存放数据;(3)使用指针与链表的实现法。
Date
: 2008-10-13
Size
: 1.05kb
User
:
cm
[
Other
]
dv
DL : 0
#include<iostream> using namespace std class Point {public: Point(int a){x=a } ~Point(){cout< \"execuing Point destructor\"<<endl } private: int x } class Circle:public Point {public: Circle(int m,int n):Point(m){radius=m } ~Circle(){cout<<\"execuing Circle destructor\"<<radius<<endl } private: int radius } int main() {Point *p=new Circle(5,12) delete p system(\"pause\") return 0 }
Date
: 2008-10-13
Size
: 2.04kb
User
:
华盛
[
Other
]
goods-link
DL : 0
使用数组或链表完成一个在控制台下运行(字符界面)的简单的商品库存信息管理系统。 商品信息包括如下字段 商品号 int CodeID 商品名称 char Name[50] 商品库存 int Mount 主程序:程序运行后,循环显示如下菜单: 1. 销售 2. 进货 3. 列举商品信息 4. 清除所有商品 5. 退出 根据用户的选择进一步提示用户输入并调用对应函数完成相应的功能。 主要的功能函数 CreateList:从goods.dat文件中读取商品库存信息,建立链表。 DestroyList:保存链表中所有商品的信息到goods.dat文件中,删除链表的所有节点,并释放相应的空间。本函数在程序退出前应至少被调用一次。 SellGoods:商品销售,由参数传入商品号和销售数量。如果不存在给定商品号的商品或销售数量大于相应商品的库存则出错;否则,从指定商品的库存中扣除相应的销售数量。当商品库存为0,则从链表中删除该商品。 StockGoods:商品进货,由参数传入商品号和进货数量。如果不存在给定商品号的商品则在链表中插入新商品;否则,增加指定商品的库存量。 ListGoods:列出所有商品的情况。
Date
: 2008-10-13
Size
: 4.13kb
User
:
abo
[
Other
]
ConvertHexStringToInt
DL : 0
将一个十六进制的字符窜转换为十进制的数的类!返回一个int!
Date
: 2008-10-13
Size
: 1006byte
User
:
wind
[
Other
]
bytechange
DL : 0
实现字节翻转的两种方法,各有所长。一个函数,只能翻转int型,但效率高。另一个函数模板,能实现 int、float、double等基本数据类型的字节翻转,但效率略低。
Date
: 2008-10-13
Size
: 1.8kb
User
:
yan
[
Other
]
verylong
DL : 0
大整数类,具有一般整数的几乎所有运算,具体包括:四则运算,输入输出,求模幂,乘法,矩阵求模幂,重载了所有int类型的运算符,int,long 等数据的兼容。使用方法与int,long等类型完全一致。
Date
: 2008-10-13
Size
: 6.23kb
User
:
superred
[
Other
]
tong_xun_lu
DL : 0
/*** 以下是函数原型*******/ int enter(ADDRESS t[]) /*输入记录*/ void list(ADDRESS t[],int n) /*显示记录*/ void search(ADDRESS t[],int n) /*按姓名查找显示记录*/ int delete1(ADDRESS t[],int n) /*删除记录*/ int add(ADDRESS t[],int n) /*插入记录*/ void save(ADDRESS t[],int n) /*记录保存为文件*/ int load(ADDRESS t[]) /*从文件中读记录*/ void display(ADDRESS t[]) /*按序号查找显示记录*/ void sort(ADDRESS t[],int n) /*按姓名排序*/ void qseek(ADDRESS t[],int n) /*快速查找记录*/ void copy() /*文件复制*/ void print(ADDRESS temp) /*显示单条记录*/ int find(ADDRESS t[],int n,char *s) /*查找函数*/ int menuSelect() /*主菜单函数*/ void clrscr(void) void gotoxy(int,int)
Date
: 2008-10-13
Size
: 4.04kb
User
:
石鹏
[
Other
]
sizeof
DL : 0
C++内置类型的大小,包括:int float double
Date
: 2008-10-13
Size
: 5.6kb
User
:
jigsong
[
Other
]
adventure
DL : 1
初学C++时的一个小程,古堡救美游戏,输入命令指引hero探险,遇到princess胜利,遇到monster结束,主要为了熟悉c++,熟悉oop思想 The program is debugged on the plat of VC 6.0 其主体结构为: int main() { Welcome() while(1) { Adventure() //游戏主体 cout<<endl<<\"Do you wanna to try it again (Yes / No) :\" cin>>Choice if(choice is not yes) //判断用户是否要继续游戏 break } return 0 int adventure() { While (1){ Command() //分析输入命令,进入下一个房间 If(meet monster) Break //gameover If (meet princess) Cout<<”you have meet the princess ,take her to a safe place”<<endl If (meetprincess && currentinlobby) Win() //win the game } }
Date
: 2008-10-13
Size
: 3.87kb
User
:
声明者
[
Other
]
DSPPrograms
DL : 0
DSP编程常用函数 double uniform(double a,double b,long int* seed) double gauss(double mean,double sigma,long int *seed) double exponent(double beta,long int *seed) double laplace(double beta,long int* seed) double rayleigh(double sigma,long int *seed) double weibull(double a,double b,long int*seed) int bn(double p,long int*seed) int bin(int n,double p,long int*seed) int poisson(double lambda,long int *seed) void dft(double x[],double y[],double a[],double b[],int n,int sign) void fft(double x[],double y[],int n,int sign)-DSP programming functions commonly used double uniform (a double, double b, long int * seed) double Gauss (double mean, double sigma, long int * seed) double exponent (double beta, long int * seed) double Laplace (double beta, * long int seed) double Rayleigh (double sigma, long int * seed) double Weibull (a double, double b, long int * seed) int bn (double p, long int * seed) int bin (int n, p double, seed long int *) int poisson (double lambda, long int * seed) void dft index (double x [], double y [], [] a double, double b [], int n, int sign) void fft (double x [], double y [], int n, int sign)
Date
: 2008-10-13
Size
: 2.16kb
User
:
山城棒棒儿军
[
Other
]
weijifen
DL : 0
微积分的数值计算函数,包括: double composite_simpson(double(*f)(double),double a,double b,int n) double romberg(double(*f)(double),double a,double b,double eps,int max_it) double gauss_legendre(double(*f)(double),double a,double b) double central_difference(double(*f)(double),double a, double h,double eps, int max_it) double runge_kuta(double(*f)(double,double),double x[],double y[],double h,int n) double proved_euler(double(*f)(double,double),double x[],double y[],double h,int n) double adams(double(*f)(double,double),double x[], double y[],double h,int n) double montecar(double(*f)(double),double a,double b,double ub,double eps,int k,int n) float uniform_random()-calculus numerical calculation functions, including : double composite_simpson (double (* f) (double), a double, double b, int n) double Romberg (double (* f) (double), a double, double b, double eps, int max_it) double gauss_legendre (double (* f) (double), a double, double b) double central_difference (double (* f) (double), a double, double h, double eps , int max_it) double runge_kuta (double (* f) (double, double), double x [], [] y double, double h, int n) double proved_euler (double (* f) (double , double), double x [], [] y double, double h, int n) double adams (double (* f) (double, double), double x [], [] y double, double h, int n) montecar double (double (* f) (double), a double, double b, double ub, double eps, int k, int n) float uniform_random ()
Date
: 2008-10-13
Size
: 2.95kb
User
:
山城棒棒儿军
[
Other
]
lxing
DL : 0
编译原理小程序 有点小问题 源程序文件内容如下: main() { int a, b a = 10 b = a + 20 } 要求输出如下: (2,”main”) (5,”(”) (5,”)”) (5,”{“} (1,”int”) (2,”a”) (5,”,”) (2,”b”) (5,” ”) (2,”a”) (4,”=”) (3,10) (5,” ”) (2,”b”) (4,”=”) (2,”a”) (4,”+”) (3,20) (5,” ”) (5,”)”)-Compiler Principle small programs have a small problem source files as follows : main () (int a, b a = b = a 10 20) output requirements are as follows : (2, "main") (5 ,"(") (5, " ) ") (5 ,"{"} (1," int ") (2," a ") (5 ,",") (2," b ") (5," ") (2," a " ) (4 ,"=") (3,10) (5, "") (2, "b") (4 ,"=") (2, "a") (4, "") (3,20 ) (5, "") (5 ,")")
Date
: 2008-10-13
Size
: 1.55kb
User
:
刘星
«
1
2
»
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.