- 博客(21)
- 收藏
- 关注
原创 排序实现
#include #include const int SIZE=9; void swap(int &a,int &b){ int temp; temp = a; a = b; b = temp; } //插入排序 稳定 void insertion_sort(int s[],int n){ int i,j; int
2011-10-31 10:57:35 337
原创 oracle note3 常用的表视图
declare v_name varchar2(10); v_sql varchar2(100); begin v_name:='name'; v_sql:='select '||v_name||' from table1 where id = 1 '; execute immediate v_sql into v_name; dbms_output.put_line(v_name)
2011-10-30 13:28:31 322
原创 oracle note2 存储过程
declare x varchar2(10):='ssss'; begin --x:='This is..'; dbms_output.put_line('x''s value is' ||x); end; / =============================== SQL> set serveroutput on -----------------if---------
2011-10-30 13:27:33 375
原创 oracle note1
list 查看缓冲区的命令 l / 执行缓冲区的命令 change 改变缓冲区的命令 c ? set save 保存缓冲区命令 @ 执行文件命令 get 查看文件命令 get c:\oracle\a.txt edit 编辑缓存区文件 column id heading "编号" describe col dname format A10 heading "部门名称"
2011-10-30 13:26:28 309
原创 利用unsigned int 溢出
请仅使用变量声明,赋值,++,及从0开始的for循环实现一个函数f(x),在x为不小于1的整数类型的情况下,使其返回值等于x-1. #include int f(int x){ unsigned int i,j; for(i=0; x; i++) { x++; } i++; for(j=0; i; j++) { i++; } return j; }
2011-10-29 20:02:52 3803
转载 vector 内存分配
#include #include using namespace std; int main() { vector iVec; cout << "容器 大小为: " << iVec.size() << "容器 容量为: " << iVec.capacity() << endl; //1个元素, 容器容量为1 iVec.push_back(1); cout << "容器 大小为:
2011-10-20 20:27:27 2121
转载 ORACLE外连接小结~ http://blog.csdn.net/wh62592855/article/details/4852908
//table1和table2为两个测试表 随便插入几条数据 SQL> select * from table1; ID NAME ---------- -------------------- 1 wh 2 wp 3 wq SQL> select * from table2;
2011-10-20 20:20:39 387
原创 全排列
#include int n = 0; void swap(int *a, int *b) { int m; m = *a; *a = *b; *b = m; } void
2011-10-19 15:47:08 249
原创 爬楼梯 struct union内存分配 大小端判断
#include #include int step(int n){ if(1==n) return 1; else if(2==n) return 2; else if(3==n) return 4; else return step(n-1)+ste
2011-10-18 20:54:49 866
原创 atoi
#include #include int myatoi(const char *str){ int result = 0; int signal = 1; if((*str>='0'&&*str<='9')||*str=='-'||*str=='+'){ if(*s
2011-10-16 18:59:04 273
原创 c ctype.h
#include #include #include #include #include #include #include static void prclass(const char* name,int (*fn)(int)){ int c; fputs(name,s
2011-10-13 09:19:19 441
原创 1的个数
#include #include #include "windows.h" #include "math.h" int countA(int v){ int num=0; while (v) { v &= (v-1); num++; } return num
2011-10-13 08:30:18 244
原创 最长上升子序列
#include using namespace std; int find(int *a,int len,int n)//若返回值为x,则a[x]>=n>a[x-1] { int left=0,right=len,mid=(left+right)/2; whi
2011-10-12 19:54:50 315
原创 最长公共子序列
#include #include using namespace std; string LCS(string s1,string s2){ string ans; int i,j; int max=0,maxj=0; int c[100]; for(i=0;i<
2011-10-12 19:50:22 211
原创 斐波那契
#include #include #define T 7 #define INF -1111 long fib(int n); long map[100]={0,1}; int main(){ printf("ssss\n"); print
2011-10-12 19:36:13 264
原创 tinyxml
#include "tinyxml.h" #include "tinystr.h" #include using namespace std; int main(){ cout<<"begin"<<endl; TiXmlDocument *myDocument = n
2011-10-12 19:35:55 249
原创 c++运算符重载
complex.h #ifndef _COMPLEX_H_ #define _COMPLEX_H_ #include using namespace std; class Complex{ friend ostream& operator<<(ostream& out,
2011-10-12 19:23:03 224
原创 获取系统时间
#include //C语言的头文件 #include //C语言的I/O int main() { time_t now;//实例化time_t结构 struct tm *timenow;//实例化tm结构指针 time(&now); timenow = l
2011-10-12 19:15:07 295
原创 字符串hash kmp算法
#include unsigned int BKDRHash(char* str){//字符串hash unsigned int seed = 131;// 31 131 1313 13131 131313 etc.. unsigned int hash = 0; w
2011-10-11 19:26:24 429
原创 虚析构函数 enum
#include #include using namespace std; enum XQ { MONDAY, TUESDAY, WEDNESDAY, THUERSDAY, FRIDAY, SATURDAY, SUNDAY }; cl
2011-10-11 19:19:40 339
原创 最大子段和问题
#include int MaxSum(int n,int *a){ int sum = 0; int b = 0,i; for(i=0;i<n;i++){ if (b>0) { b+=a[i]; }else b = a[i]; if (b>sum
2011-10-11 19:06:37 227
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人