- 博客(36)
- 收藏
- 关注
转载 ORACLE to_char的用法
The following are number examples for the to_char function.to_char(1210.73, 9999.9)would return 1210.7to_char(1210.73, 9,999.99)would return 1,210.73to_char(1210.73,
2009-01-19 09:35:00
210
原创 JAVASCRIPT实现子网划分
http://www.w3.org/1999/xhtml"> 无标题页 /* 计算可用IP段 */ function getIPs() { var zjip=document.getElementById("zjip"); var zjdz=document.getElementById("zjdz");
2009-01-18 15:29:00
346
原创 C#获取系统驱动器信息
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;u
2008-12-16 22:51:00
277
转载 VS2005快捷键
调试快捷键 F6: 生成解决方案Ctrl+F6: 生成当前项目F7: 查看代码Shift+F7: 查看窗体设计器F5: 启动调试Ctrl+F5: 开始执行(不调试)Shift+F5: 停止调试Ctrl+Shift+F5: 重启调试F9: 切换断点Ctrl+F9: 启用/停止断点Ctrl+Shift+F9: 删除全部断点F10: 逐过程Ctrl+F10: 运行到光标处F11: 逐语句 编辑快
2008-12-05 12:56:00
198
原创 获取ORACLE中视图和存储过程
获取视图select view_name key,view_name text from user_views order by view_name获取存储过程select object_name keyname,object_name text from user_objects where object_type=PROCEDURE order by object_name
2008-12-05 12:53:00
361
原创 JAVA文件操作
1)Mkdir()方法:在E盘根下建立文件夹java和在java下建立子文件夹zy;2)write()方法:在文件夹zy下建立文件yy.txt,并将从键盘随机输入的若干数据写入到文件yy.txt中。3)read()方法:从文件yy.txt中读取内容并输出。4)方法copyfile():将文件yy.txt拷贝到java下并生成文件f1.txt。5)pp()方法:求取并输出文件
2007-11-22 09:31:00
438
原创 给定一个字符串,判断是否能交换相邻字符变成回文串(程序员第11期算法擂台)
此题目为《程序员》杂志第11期算法擂台题目从键盘输入一个长度为n的字符串,交换相邻两个字符的位置,判断该字符串是否可以经过有限次交换变成回文串,如果可以,输出交换次数,如果不可以,则输出“Impossible”。我给出下面算法的C++程序解法,但是不知道这个程序是否可以保证所得的交换次数是否可以达到最优,也就是经过最少次数交换,变成回文串。仅供参考,如有更好的想法,CALL ME!大家一起
2007-11-07 22:50:00
1781
原创 Microsoft Visual Studio 2005编译MFC(WIN32)程序错误error C2664
VC++6.0用户在使用VS2005编写WIN32或者MFC程序时,经常使用函数:MessageBox("提示信息。"),但是在VS2005编译时候出错,出错信息如:错误 1 error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [17]”转换为“LPCTSTR” d:/我的文档/visual studio 2005/pr
2007-11-02 18:30:00
3303
3
原创 【新手教程】用NetBeans 5.5.1编写JAVA控制台程序
本文旨在想新手介绍使用集成开发环境编写JAVA控制台程序。高手绕道,呵呵。1,软件安装:JDK6, NetBeans 5.5.1,eclipse。前两个可从SUN网站上下的,其中有个整合的安装包,包含JDK6,和NetBeans 5.5.1。http://java.sun.com/ eclipse:http://eclipse.org 免费下载。2,NetBeans 5.5.1的
2007-09-28 19:38:00
2049
原创 操作系统课程设计-页面置换算法
程序代码:#include #include #define Bsize 3#define Psize 12using namespace std;int QString[Psize];void P_String(){ int i; srand((unsigned)time(NULL)); for(i=0;i { QString[i]=rand()*9/RAND_MAX+1; } co
2007-08-30 19:21:00
2214
4
原创 FIFO页面置换算法_改进版
在前段时间发布了一个关于FIFO页面置换算法的程序(可翻看以前的文章),旧程序在显示方面不直观,最近修改了一下,把新的发出来大家借鉴和学习,欢迎批评指教。#include #define Bsize 3#define Psize 12struct pageInfor{ int content;//页面号 int timer;//被访问标记};class Fifo_replace{publ
2007-08-13 21:39:00
7821
1
转载 Windows下JAVA环境变量的设置祥解
Windows下JAVA环境变量的设置祥解Windows下JAVA用到的环境变量主要有3个,JAVA_HOME、CLASSPATH、PATH。下面逐个分析。JAVA_HOME指向的是JDK的安装路径,如x:/JDK_1.4.2,在这路径下你应该能够找到bin、lib等目录。值得一提的是,JDK的安装路径可以选择任意磁盘目录,不过建议你放的目录层次浅一点,如果你放的目录很深,比如x:/XXX
2007-08-11 00:23:00
426
原创 页面存储管理------FIFO页面淘汰算法
#includeusing namespace std;int pagenum=0; ///内存的页面数int total=0; ///要访问的叶面总数int lacknumber=0; ///缺页的总数void main(){ int array[1][20]; //0代表没有内容 for(in
2007-06-23 23:28:00
2682
2
原创 进程调度------最高优先级算法模拟
本程序是操作系统的一个实验,程序本身就是一个数据结构的队列问题,比较简单,就不进行说明了。 #include using namespace std;#define error 0#define ok 1#define NULL 0enum process_state{W,R,F}; //状态枚举类型(等待,运行,就绪)typedef struct PCBNode
2007-06-23 23:24:00
1225
1
原创 通过icmp.dll编程实现ping命令
//main.cpp #include "stdafx.h"#include #include #include "icmpdefs.h"using namespace std;int doit(int argc, char* argv[]){//[bugfree] 建议将这个argc和argv的处理拿到main函数中 // 检查命令行参数 if (argc
2007-06-23 17:49:00
802
原创 计算机网络实验-----编程获取本机IP和MAC地址
#include #include #include #include #include #include #pragma comment(lib,"ws2_32.lib")#pragma comment(lib,"netapi32.lib")void CheckIP(void) { WSADATA wsaData; char name[155]; char *ip
2007-06-23 17:47:00
892
原创 龙贝格积分法
#include #include #define eps 0.0000001#define max 20double f(double x){ if(x==0) return 1; else return (sin(x)/x);}void romberg(double a,double b){ double t[max][4]={0},h=1.0,e=1.0+eps; double fn
2007-06-08 22:23:00
924
1
原创 解线性方程组的Jacobi迭代法和Gauss-Seidel迭代法
#include #include #define eps 0.0001#define max 100#define N 10double norm_inf(double x[],int n){ double norm; int i; norm=fabs(x[0]); for(i=1;i { if(fabs(x[i])>norm) norm=fabs(x[i]); } return no
2007-06-08 22:20:00
2668
3
原创 数值计算方法 牛顿迭代,简单迭代,二分法
#include #include #include double f1(double x);void erfenfa(double a,double b){ double root,fa,fb,froot; int i,act_b; fa=f1(a); fb=f1(b); if(fa*fb>0) { printf("方法错误。"); exit(0); } for(i=1;i
2007-06-08 22:06:00
1669
1
原创 函数形参,传递指向指针的引用
函数形参,传递指向指针的引用假设我们想编写一个交换两个整数的SWAP类似的函数,实现两个指针的交换,已知需用*定义指针,用&定义引用。void swap(int *&a,int *&b){int *temp=b;b=a;a=temp;}int *&a 的定义从右向左理解:a是指针的引用。int main(){int a=10;int b=20;int *s=&a;int *t=&b
2007-04-29 23:32:00
1046
原创 销售管理程序(C语言)
#include #include #include typedef struct person//销售员{ int name;}person;typedef struct product//产品{ int p_name; float p_money;}product;typedef struct note//便条{ person a; product b;}note;typedef struct
2006-07-09 14:23:00
1321
原创 图的遍历和生成树求解实现(邻接矩阵、邻接表 —图的深度广度遍历算法的实现和最小生成树PRIM和KRUSCAL算法的实现)
#include #include using namespace std; #define int_max 10000#define inf 9999 #define max 20//…………………………………………邻接矩阵定义……………………typedef struct ArcCell{ int adj; char *info;}ArcCell,AdjMatrix[20][20];typede
2006-07-05 21:29:00
5248
4
转载 绝对经典 C++初学者必看的50个建议
1.把C++当成一门新的语言学习(和C没啥关系!真的。); 2.看《Thinking In C++》,不要看《C++变成死相》; 3.看《The C++ Programming Language》和《Inside The C++ Object Model》,不要因为他们很难而我们自己是初学者所以就不看; 4.不要被VC、BCB、BC、MC、TC等词汇所迷惑——他们都是集
2006-07-05 21:09:00
813
1
原创 数组合并
#include "stdafx.h"#include "iostream.h"#define max 100typedef struct list{ int a[max]; int length;}list;void chushihua(list &l){ l.length=0;}void fuzhi(list &l){ int i=0; cout while(1) {
2006-07-05 21:09:00
755
原创 猴子选大王——链表的实现
//在N个猴子中,从任意个猴子开始数1,2,3,数到3的猴子被驱除,//下一个继续依次数1,2,3,每次数3的猴子都被驱除,//剩余最后一个猴子就是大王#include "stdafx.h"#include "iostream.h"#include "stdio.h"#include "malloc.h"typedef struct lnode{ int a; lnode *next;
2006-07-05 21:08:00
1043
原创 行列式求值
用了一个多小时,晚上实在有点不想睡觉,起来写DD数学建模的老师叫我用MATLAB来写,可是我还用得不好,程序老出错没办法啊,就先用C++来写,程序没错哈,有哪个朋友有更好的算法,记得告诉我哈。我在这里谢了…… #include#define NUM 15class juzhen{private: double J[NUM][NUM]; int flag;
2006-07-05 21:07:00
1052
原创 西南交通大学研究生入学考试最后一道数据结构题目…用两个堆栈表示一个队列
//用两个堆栈表示一个队列。完全原创哈,有更好算法的朋友请告诉我下哈,谢谢。#include "iostream.h"#include "malloc.h"typedef struct Stack //定义堆栈{ int *base; int *top; int stacksize;}Stack; int InitStack(Stack &s) //初始化堆栈{ s.base=(
2006-07-05 21:06:00
1580
原创 二叉树的实现和遍历
#include #include //定义二叉树typedef struct bitnode{ int data; struct bitnode *lchild,*rchild;}bitnode,*bitree;//创建二叉树利用先序创建void createbitree(bitree *T){ int dat; printf("请输入节点数据:"); sca
2006-07-05 21:05:00
4389
4
转载 Tc2.0 编写俄罗斯方块游戏
Tc2.0 编写俄罗斯方块游戏 很多编程爱好者都编写过俄罗斯方块的游戏程序。很久以前,我用Tc2.0也做过一个;最近有好些朋友看见我以前的俄罗斯方块的程序后, 问我是怎么做的。我一直想把这个程序的整个过程写一份详细的东西,与各位编程爱好者分享,一直没空。正好现在放假了,而且离回家还有几天。于是我就把这个程序重新写了一遍,尽量使程序的结构比较清晰好懂一些。同时写了下面的这份东西。 俄
2006-07-05 21:00:00
2360
原创 哈夫曼编码的实现
#include#includeusing namespace std;typedef struct { int weight; int flag; int parent; int lchild; int rchild;}hnodetype;typedef struct { int bit[10]; int start; char leaf;}hco
2006-07-05 20:58:00
1449
6
原创 利用邻接表存储无向图,并深度遍历和广度遍历图
#include #include #include #define max 20int visited[max];int w;typedef struct arcnode{ int adjvex;//该弧指向的顶点的位置 struct arcnode *nextarc;//弧尾相同的下一条弧 char *info;//该弧信息}arcnode;typedef struct vnode{
2006-07-05 20:57:00
2800
1
转载 求PI的超级无敌程序。四行可求后800位小数
#include long a=10000,b,c=2800,d,e,f[2801],g; main(){for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a) for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);}
2006-07-05 20:56:00
522
原创 数据结构二分法查找
//二分法查找#include #include #include typedef struct sstable{ int a[100]; int length;}sstable;void chushihua(sstable &l){ l.length=0;}void fuzhi(sstable &l){ int i=0; cout while(1) { cin>>l.a[i];
2006-07-05 20:54:00
2304
1
转载 执着的数字思想者——Pascal之父(转贴)
Niklaus Wirth 其人 图:Niklaus Wirth 近照引言:程序=算法+数据结构尼克劳斯·沃斯(Niklaus Wirth)教授,Pascal系列语言之父,世界闻名的计算机科学家。他是苏黎世联邦理工学院(Swiss Federal Institute of Technology 简称ETH)教授,因发明了Pascal计算机编程语言(1970年)及其它几种计算机语言而著名。其中的
2006-03-08 11:21:00
2543
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人