自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

天涯明月的专栏

我思故我在

  • 博客(30)
  • 资源 (17)
  • 收藏
  • 关注

转载 The Archive of Interesting Code(有各种算法,牛!!!)

The Archive of Interesting CodeThe Archive of Interesting Code is an (ambitious) effort on my part to research, intuit, and code up every interesting algorithm and data structureever invented. I

2012-04-24 13:58:23 1340

原创 几个不错的C++/VC++网站(个人收藏额~~)

cplusplus: http://www.cplusplus.comlearncpp:http://www.learncpp.com/C++ reference: http://en.cppreference.com/w/cppMSDN 库(中文):http://msdn.microsoft.com/zh

2012-04-19 21:45:30 1195

原创 个人建站

1.购买域名(如在http://www.xinnet.com购买feifanyijia.com)。2.申请免费空间(如在http://www.pdxx.net海外免费免备案(200M))。3.免费空间审核通过后,参考:浦东信息港免费空间申请引导。4.申请免费数据库(如在http://www.pdxx.net海外免费免备案(20M))。5.下载php源码并上传至免费空间。

2012-04-30 20:23:05 706

原创 shell 编程疑问01

#!/bin/bash#program:# This program shows "Hello World!"in your screen:#History:#2012/4/29 ZXF007 First releasePATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binecho -e "He

2012-04-29 10:47:12 404

转载 程序员技术练级攻略(来自:http://coolshell.cn/articles/4990.html)

月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to those who want to start programming》,我的朋友(他在本站的id是Mailper)告诉我,他希望在酷壳上看到一篇更具操作性的文章。因为他也是喜欢编程和技术的家伙,于是,我让他把他的一些学习Python和Web编程的一些点滴总结一下。于是他给我发来了一些他的心得和经历

2012-04-24 13:44:57 1009

转载 Why C++ ? 王者归来(转自:http://coolshell.cn/articles/6548.html)

因为又有人邀请我去Quora的C2C网站去回答问题去了,这回是 关于 @laiyonghao 的这篇有点争议的博文《2012 不宜进入的三个技术点》ActionScript,Thread 和 C++, C++争议的争议最大。(要我说,.NET比C++更需要慎重进入,呵)。我就在这里回复一下这个问题吧。正好我一个月前看到一个视频,这个演讲视频还比较著名,这个演讲者是Exceptional C

2012-04-24 13:15:44 915

原创 迭代贪心算法c++源码实现

//迭代贪心算法的实现//test2.cpp#include using namespace std;int i=0,n=11,k=0;int b[10];void GreedyActivitySeletor(int* s,int *f){ for(int m=i+1;m<=n;m++) if (s[m]>=f[i]) { k++; b[k]=m;//b[

2012-04-24 11:41:51 2304

原创 递归贪心算法c++源码实现

//递归贪心算法的实现//test1.cpp#include using namespace std;void RecursiveActivitySeletor(int* s,int *f,int i,const int n){ int m=i+1; while(m<=n&&s[m]<f[i]) m+=1; if (m<=n) { cout<<"a["<<m<<"]"<

2012-04-24 11:06:09 2708

转载 指向字符串的指针 和 字符数组的区别

C语言的字符串有两中表现形式:char *ch="hello world";char ch[]="hello world";这两种形式都能实现字符串的存储,但有区别:1、复制的不同对于字符数组,我们可以对某个字符进行赋值:char ch[4]='r';这将对第五个元素进行赋值,但不能以下面方式赋值:char ch[20];ch="hello worl

2012-04-23 15:13:06 3717

转载 Map 使用

Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的,后边我们会见识到有

2012-04-23 12:53:25 366

转载 常见的预处理命令总结

常见的预处理命令总结:# 空指令将位于其后面的任何字符用引号引起来:#define show(x) cout<<#x;然后调用show(x),show(hello world);相当于:cout#include 在该命令位置处包含一个原代码文件#define 定义一个宏#define x 5int a[x];相当于:int a[5];#define仅进行两个字

2012-04-23 12:48:18 754

原创 命名空间namespace的使用

头文件:namespace.hnamespace ns{ int x=2;}源码:test.cpp#include #include "namespace.h"using namespace std;int main(){ int x=1; std::cout<<ns::x<<std::endl;//ns为头文件namespace中的空间名,使用ns::x指

2012-04-22 23:42:53 527

转载 字符串输入/输出流类stringstream

#include #include #include using namespace std;int main (int argc,char *argv[]) { //定义一个stringstream对象sstr,并用a填充字符串缓冲区 stringstream sstr("a"); //调用put函数往字符串缓冲区插入一个字符b,插入位置是开头,故将a覆盖掉了 sstr.p

2012-04-22 22:57:21 3341

转载 免费自助建站空间集中推荐 (文章来源:爬网志)

看到这篇文章写得很不错,总结的很全面,因此就从精华之家转过来了。jimdo 和viviti自己正在用,感觉jimdo更适合于发布诸如产品介绍之类的东西,100个网页以下的网站足可以应付,操作比较灵活,上手容易,很短的时间就能建起一个漂亮的小站。但是扩展性不好,网站内容一多,就会显得很乱。如果是写博,强烈推荐viviti,强大的分类功能,即使内容再多也可轻松管理,支持批量操作,超赞其自带的站内搜索功

2012-04-21 14:20:02 2342

原创 STL Algorithms : replace_copy、replace_copy_if

这是学习C++编程思想第六章(通用算法)后,写的一个算法的实现,很简单,为了以后回忆这块时快速上手,就放上一段小的代码:#include #include #include using namespace std;bool myfn(char c) { return c=='3';}//判断字符是否为‘3’int main(){ char a[]={'4','1','3'

2012-04-21 12:39:16 508

转载 C语言获取系统时间的几种方式 !

http://blog.csdn.net/johnny710vip/article/details/6693319C语言中如何获取时间?精度如何? 1 使用time_t time( time_t * timer ) 精确到秒2 使用clock_t clock() 得到的是CPU时间 精确到1/CLOCKS_PER_SEC秒3 计算时间差使用double diff

2012-04-16 12:47:42 2103

原创 从字符串中提取整数

#include #include #include using namespace std;int main(){ string str="234 567 0abc123 ?789"; istringstream is(str); int i; char ch; cout<<"输出字符串中的数字:"<<endl; while (is>>ch) { if (ch>='

2012-04-14 16:02:59 8951

转载 C++笔试题大全----下

一、输入一个n ,然后在屏幕上打印出NxN的矩阵!例如,输入一个3,则1 238 947 65输入一个4,则1 2 3 41213 14 51116 15 610 98 7参考答案: #include#include#define N 10 void printCube(int

2012-04-13 10:20:27 1209

转载 C++笔试题大全----上

1.求下面函数的返回值(微软)int func(x){int countx = 0;while(x){countx ++;x = x&(x-1);}return countx;}假定x = 9999。 答案:8思路:将x转化为2进制,看含有的1的个数。 2. 什么是“引用”?申明和使用“

2012-04-13 10:18:26 1234

原创 读取当前程序路径

//读取当前程序路径#include using namespace std;int main(int argc,char *argv[]){ cout<<argv[0]<<endl;//要理解主函数中参数含义 return 0;}

2012-04-08 11:48:25 479

原创 C++ 十进制'纯'小数转换为任意进制的小数

#include using namespace std;int main(){ float n; int p,c,m=0,precision=0,s[100]; cout<<"输入要转换的数字:"<<endl; cin>>n; cout<<"输入要转换的进制:"<<endl; cin>>p; cout<<"输入精度precision:"<<endl; cin>>preci

2012-04-07 14:35:50 7253

原创 C++进制转换(十进制转二进制、八进制、任意进制)

十进制转二进制://十进制转二进制#includeusing namespace std;void printbinary(const unsigned int val){ for(int i = 16; i >= 0; i--) { if(val & (1 << i)) cout << "1"; else cout << "0"; }}int m

2012-04-07 11:54:58 98543 6

原创 3-3 要求不区分大小写,如abcBA仍认为是回文

#include #include #include using namespace std;/*void resort(char s[]){char temp;for (int i=0,j=strlen(s)-1;i!=j;i++,j--)//对j的初始化是关键{temp=s[i];s[i]=s[j];s[j]=temp;}}*/void resort(strin

2012-04-05 22:00:31 1113

原创 以app模式向文本文件末尾写入内容

#include #include #include int main(){ using namespace std; // We'll pass the ios:app flag to tell the ofstream to append // rather than rewrite the file. We do not need to pass in ios::out

2012-04-05 17:05:44 933

原创 从文本文件中读内容(显示到控制台界面上)

优化前的代码:#include #include #include int main(){ using namespace std; // ifstream is used for reading files // We'll read from a file called Sample.txt //char str[256]; //cout << "Enter the

2012-04-05 14:20:32 2213

原创 向文本文件中写入内容

#include #include #include using namespace std;int main(){ // ofstream is used for writing files // We'll make a file called Sample.txt ofstream outf("Sample.txt");//注意:此处的等价于:ofstream outf;o

2012-04-05 14:13:41 705

原创 按行输入的实现方法

有三种方法实现按行输入:成员函数get()。成员函数getline()。定义在头文件中的全局函数getline()。前两个函数有三个参数:.指向字符缓冲区的指针,用于保存结果。.缓冲区的大小(为了保证缓冲区不会溢出)。.结束字符,根据结束字符判断停止读入操作,默认为'\n',在输入过程中遇到结束字符时,这两个函数都会在结果缓冲区莫为存储一个零。前两个

2012-04-05 13:26:09 1297

原创 3-2 判断字符串是否为回文

#include #include #include using namespace std;/*void resort(char s[]){char temp;for (int i=0,j=strlen(s)-1;i!=j;i++,j--)//对j的初始化是关键{temp=s[i];s[i]=s[j];s[j]=temp;}}*/void resort(strin

2012-04-05 12:53:37 614

原创 3-1 编写并测试一个函数,逆转字符串中字符顺序

#include #include #include using namespace std;void resort(char s[]) //或者是resort(char *s){ char temp; for (int i=0,j=strlen(s)-1;i<j;i++,j--) //对j的初始化是关键 { temp=s[i];s[i]=s[j];s[j]=tem

2012-04-05 11:38:12 1324

转载 Sizeof与Strlen的区别与联系(转载)

Sizeof与Strlen的区别与联系一、sizeof    sizeof(...)是运算符,在头文件中typedef为unsigned int,其值在编译时即计算好了,参数可以是数组、指针、类型、对象、函数等。    它的功能是:获得保证能容纳实现所建立的最大对象的字节大小。    由于在编译时计算,因此sizeof不能用来返回动态分配的内存空间的大小。实际上,用size

2012-04-05 10:45:28 421

《算法导论》原版英文课件12

Lecture 12 Skip Lists.pdf

2012-07-23

《算法导论》原版英文课件11

Lecture 11 Augmenting Data Structures, Dynamic Order Statistics, Interval Trees.pdf

2012-07-23

《算法导论》原版英文课件10

Lecture 10 Red-black Trees, Rotations, Insertions, Deletions.pdf

2012-07-23

《算法导论》原版英文课件9

Lecture 9 Relation of BSTs to Quicksort - Analysis of Random BST.pdf

2012-07-23

《算法导论》原版英文课件8

Lecture 8 Universal Hashing, Perfect Hashing.pdf

2012-07-23

《算法导论》原版英文课件7

Lecture 7 Hashing, Hash Functions.pdf

2012-07-23

《算法导论》原版英文课件5

Lecture 5 Linear-time Sorting Lower Bounds, Counting Sort, Radix Sort.pdf

2012-07-23

《算法导论》原版英文课件6

Lecture 6 Order Statistics, Median.pdf

2012-07-23

《算法导论》原版英文课件4

Lecture 4 Quicksort, Randomized Algorithms.pdf

2012-07-23

《算法导论》原版英文课件3

Lecture 3 Divide-and-Conquer Strassen, Fibonacci, Polynomial Multiplication.pdf

2012-07-23

《算法导论》原版英文课件1

Lecture 1 Administrivia; Introduction; Analysis of Algorithms, Insertion Sort, Mergesort.pdf

2012-07-23

《算法导论》原版英文课件2

Lecture 2 Asymptotic Notation; Recurrences; Substitution, Master Method.pdf

2012-07-23

电脑丢失追踪软件

后台运行,秘密开启摄像头将盗贼拍照,并通过email发送到指定邮箱,远程操控计算机

2012-04-21

《Windows XP 使用技巧》大全!

非常棒的资源,与大家分享,我也是从网上下载的。

2009-12-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除