自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 资源 (1)
  • 收藏
  • 关注

原创 枚举

#include int main() { enum Family{Jeason,Maggie,Mike,Carol,Ben}; int nInput=0; Family Home; scanf("%d",&nInput); switch(nInput) { case 1: Home = Jeason; break; case 2: Home = Maggie; break; case 3: Ho

2009-06-04 14:53:00 509

原创 函数指针

#includeint  add(int x,int y){ return x+y;}int  mul(int x,int y){ return x*y;}int binary(int x,int y,int(*f)(int a,int b)){ return  (*f)(x,y);}int main(){ int result1 = binary(2,101,mul); int result

2009-06-04 13:30:00 419

原创 Topcoder题代码

Problem Statement      Lets say you have a binary string such as the following: 011100011 One way to encrypt this string is to add to each digit the sum of its adjacent digits

2009-05-30 13:08:00 1352

原创 bitset用法

1.bitset基本用法:     #include #include using namespace std;int main (){  bitset mybits;  cout "enter a binary number: ";  cin >> mybits;  if (mybits.any())    cout "mybits has " int)mybits.count() "

2009-05-30 02:42:00 1753

原创 set用法

2009-05-29 17:54:00 602

原创 map用法

1.map基本用法:    样例代码:#include#include#include#include#include#include#includeusing namespace std;int  main(){   map  mymap;   map::iterator  it;   mymap[b] = 100;   mymap[a] = 200;   mymap

2009-05-28 20:39:00 5604

原创 list 用法

   1. assign用法:             void assign ( Iterator first, Iterator last );   //Iterator是任一种容器的泛型指针,list 和vector可       void assign (  int  n, const T& u );              //u是向list中加入的值,n是u的个数  

2009-05-28 13:15:00 1208

原创 2009.5.27

    今天下午听了Success  Factors 的讲座,略有收获,现简记如下:     1.要有积极向上的工作态度,这直接决定了实习生的去留;     2.要有激情,一旦工作就全力投入,并把工作做好;     3.要有扎实的基本功.计算机硬件,C,C++的基本功要打扎实;     4.不能太过依赖 Microsoft提供的IDE等编程平台,对Linux,Mac

2009-05-27 14:34:00 417

原创 Topcoder 字符串转换题

原题:   Problem Statement      Computers tend to store dates and times as single numbers which represent the number of seconds or milliseconds since a particular date. Your task

2009-05-25 01:56:00 753

原创 C语言学习

1.数组名作函数参数:   样例:   #includeint sum(int a[10]){ int sum=0; for(int i=0;i  sum+=a[i]; return sum;}int  main(){ int nArray[10]={1,2,3,4,5,6,7,8,9,10}; printf("%d/n",sum(nArray)); return 0;} 2. 

2009-05-24 18:44:00 538

原创 部分几何函数

#include#include#include#includeusing namespace std;double  fDotToDot(int Startx,int Starty,int Endx,int Endy)                                 //点到点{  double  dTemp=(Startx-Endx)*(Startx-Endx)+(Star

2009-05-23 16:57:00 484

原创 Topcoder题代码

 原题:      You have a certain amount of money to give out as a bonus to employees. The trouble is, who do you pick to receive what bonus? You decide to assign a number of points to each

2009-05-21 01:04:00 1041

原创 vector可用的函数

1.find   返回iterator       样例代码: #include #include #include int main( ) { using namespace std; vector L; L.push_back( 1 ); L.push_back( 2 ); L.push_back( 3 ); L.push_back( 4 ); L.push_back( 5 );

2009-05-21 00:56:00 532

原创 string类

 函数名 描述 begin 得到指向字符串开头的Iterator end 得到指向字符串结尾的Iterator rbegin 得到指向反向字符串开头的Iterator rend 得到指向反向字符串结尾的Iterator size 得到字符串的大小 length 和size函数功能相同

2009-05-20 02:47:00 1463

原创 2008.5.19

      由于各种原因,现在开始提前研究STL。对vector研究如下:      1.元素数量:clear()后,size()返回0,而capacity() 返回clear()前vector中的元素个数;            2.erase(pos)   删除pos位置的数据,并返回下一位置的数据,pos 是iterator,返回值仍为iterator;         

2009-05-19 22:42:00 493

原创 2009.5.16

      今晚研究了会函数和数学库,然后研究了汉诺塔问题。虽然冥思苦想一小时,但还是没找到思路。后来看了课本上的思路分析,终于明白了,然后自己实现了代码。究其原因,就是因为没有找到递归中的通项。还是盲目照经验,结果函数就设计错误。看来以后遇到递归问题,一定先把问题搞透,由N到1找出通项。今晚虽然没有自己找到正确思路,但是彻底理解了汉诺塔问题,并且开拓了思路,下面是我写的汉诺塔问题代码:   

2009-05-16 00:50:00 442

原创 2009.5.14

 本人通过实验发现:scanf函数不能输出含有空格符的字符串,而gets函数能输出含空格符的字符串。  下面是本人自己写的字符串复制函数Mystrcpy():    void  MyStrcopy(char* str1,char* str2){ int i=0,j=0; while(1) {  while(str2[j]!=/0)  {   str1[i]=str2[j];  

2009-05-14 20:57:00 317

原创 进制转换

%d  : 输出十进制;  %o:输出八进制; %x:输出十六进制。 

2009-05-14 18:06:00 394

原创 2009.5.12

今天研究C语言,有所收获,现总结如下: 1. int  a,b=0  : a不初始化,b初始化为0; 2. int  a=0,b=0 : a,b均初始化为0; 3.字符输入函数getchar()与字符输出函数putchar();    用法样例:    char  c;   c = getchar();   putchar(c);    上面

2009-05-12 18:34:00 422

原创 开始研究C语言

以前学C语言时没认真研究,只学了点皮毛,这次我要学得深入一些,争取小有收获。

2009-05-12 18:32:00 517

国际大学生程序设计竞赛试题解析

阅读该书,可以接触到国际水准的编程题目,并且学习相应的解题思路,有助于技术的提升和思维水平的提高.

2011-11-13

空空如也

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

TA关注的人

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