http://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/清单 5. 使用
yield 的第四版 def fab(max): n, a, b = 0, 0, 1 while n >> for n in fab...
分类:
编程语言 时间:
2014-05-20 13:45:03
阅读次数:
319
integer to String :int i = 42;String str =
Integer.toString(i);orString str = "" + i double to String :String str =
Doubl...
分类:
编程语言 时间:
2014-05-20 12:54:45
阅读次数:
358
public class Paixu { public static void
main(String[] args) { paixu(); } public static void paixu(){ int [] a =
{23,12,15,2,4,10}; ...
分类:
其他好文 时间:
2014-05-20 12:47:59
阅读次数:
193
本例采用jsoncpp-src-0.6.0-rc2-amalgamation.tarjava调用语句
int id = 1001; String name = "Kevin"; String result = system.toBuildJson(id,
name); Log.i(TAG,St...
分类:
Web程序 时间:
2014-05-20 12:29:01
阅读次数:
387
1. string转const char* string s = "abc"; const
char* c_s = s.c_str();2. const char*转string 直接赋值即可 const char* c_s = "abc";
string s(c_s);3. string转char...
分类:
其他好文 时间:
2014-05-20 12:01:33
阅读次数:
178
有时候,我们需要在计算机启动的时候就启动某些程序,不要人干预。这里,提供一种让程序开机自动运行的方法。见下面代码:BOOL
CXXX::SetAutoRun(CString strPath){CString str;HKEY hRegKey;BOOL
bResult;str=_T("Software...
分类:
其他好文 时间:
2014-05-20 11:53:15
阅读次数:
217
1.把数字转换为字符串
【函数描述】str=num2str(A):把数组A中元素取小数点后四位,并转换为字符串。 【函数实例】把数字转换为字符串,输入语句:
str1=num2str(pi) str2=num2str(eps) 输出结果: str1 =3.1416 str2 =2.2204e-016...
分类:
其他好文 时间:
2014-05-20 11:40:58
阅读次数:
248
strcpy 原型:extern char *strcpy(char *dest,char
*src); 用法:#include 功能:把src所指由NULL结束的字符串复制到dest所指的数组中。
说明:src和dest所指内存区域不可以重叠且dest必须有足够的空间来容纳src的字符串。 ...
分类:
其他好文 时间:
2014-05-20 11:25:54
阅读次数:
246
戳我去解题Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".分析:高精度加法,只是将10进制的高精度加法 换成了 2进制的高精度加法首先将 两个...
分类:
其他好文 时间:
2014-05-20 11:21:52
阅读次数:
224
http://www.cnblogs.com/cython/articles/2169009.htmlitertools模块包含创建有效迭代器的函数,可以用各种方式对数据进行循环操作,此模块中的所有函数返回的迭代器都可以与for循环语句以及其他包含迭代器(如生成器和生成器表达式)的函数联合使用。ch...
分类:
编程语言 时间:
2014-05-20 07:54:59
阅读次数:
655