fstream fout;
//(1)以输出的方式打开文件,若文件不存在建立文件,若文件存在将文件长度置为0
fout.open("D:/1.txt",ofstream::out|ofstream::trunc);//不能用||
if (!fout.is_open())
{
return;
}
//(2)以输出的方式打开文件,如果没有文件,那么生成空文件;如果有文件,那么清空...
分类:
其他好文 时间:
2015-07-30 17:13:12
阅读次数:
273
JAVA基于位移的 int类型和tyte[]之间转换 [java] view plaincopy/** * 基于位移的int转化成byte[] * @param int number * @return byte[] */ public static byte[] intToByte...
分类:
编程语言 时间:
2015-07-30 16:45:41
阅读次数:
128
class Demo(object): def __init__(self,timer): self.__timer=timer self.__index=0 def __iter__(self): return self def next...
分类:
其他好文 时间:
2015-07-30 16:43:47
阅读次数:
116
var x = 'outer'; (function() { var x = 'inner'; eval('x'); // "inner" })();var num=9;var retNum = new Function("$", "$=5+$;return $")(num);con...
分类:
其他好文 时间:
2015-07-30 16:36:57
阅读次数:
132
var _absUrl = (function () { var a; return function (url) { if (!a) a = document.createElement('a'); a.href = url; return a...
分类:
Web程序 时间:
2015-07-30 16:35:04
阅读次数:
107
Problem Definition:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just l...
分类:
其他好文 时间:
2015-07-30 16:24:09
阅读次数:
151
Makefile文件的规则格式TARGET:PREFEQUISTES COMMANDSmain.c
#include
#include int main(int argc,char *argv[]){
printf("%d",getNumber());
return 0;
}utility.h
int getNumber();utility...
分类:
移动开发 时间:
2015-07-30 14:55:05
阅读次数:
251
题目Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:
Given n = 13,
Return 6, because digit 1 occurred in the following n...
分类:
其他好文 时间:
2015-07-30 13:33:17
阅读次数:
141
所谓的事件有两种:监听事件和浏览器对特殊标签元素的默认行为事件。监听事件:在节点上被监听的事件操作,如 select节点的change事件,a节点的click事件。浏览器的默认事件:特定页面元素上带的功能,如a标签的href跳转,表单的提交事件。执行监听事件在先,浏览器默认事件在后,所以可以在监听事...
分类:
Web程序 时间:
2015-07-30 13:09:41
阅读次数:
172
+ (NSString *)bankNumber:(NSString *)number{ if (number == nil) { return nil; } NSString *str = @"****"; NSString *starStrNumber = [number su...
分类:
其他好文 时间:
2015-07-30 12:59:39
阅读次数:
180