http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net
发布时间:2011-11-30 19:43:10
struct Derived:Base{ Derived(int i):mem(i) {} int get_mem() { return Base::mem;}private: int mem;};int main(){ Derived d(43); int resu.........【阅读全文】
发布时间:2011-11-30 13:46:34
#include <iostream>using namespace std; struct Base { static void statmem() {}}; struct Derived:Base { void f(const Derived &);}; void Derived::f(const Derived &derived_obj).........【阅读全文】
发布时间:2011-11-30 10:59:44
>>> str1='Bruce.Lee'>>> lis1=list(str1)>>> lis1['B', 'r', 'u', 'c', 'e', '.', 'L', 'e', 'e']>>> tmp1=reduce((lambda x,y:x+y),lis1)>>> tmp1'Bruce.Lee'>>> tmp2=''.join(lis1)>>> tmp2'Bruce.Lee'>>> ......【阅读全文】
发布时间:2011-11-30 10:26:26
#coding:gbks1=[1,2,3,4,5]s2=[11,12,13,14,15]m=map(lambda x,y:x+y,s1,s2)print "type(m) is:",type(m)print "m=",ms=[1,2,3,4,5]sum=reduce((lambda x,y:x+y),s)print "type(sum) is:",type(sum)print "sum=",sum 运行结果:type(m) is: <type 'list'>m= [12, 14, 16, 18, 20]type(.........【阅读全文】