贵灯提供的简单打印函数,非原创; 注意: do{}while(false); 的使用(内部多个判断,用
do false 中的 break 可以避免使用 if true 引起的嵌套层数过多); 关键段 CRITICAL_SECTION 的使用,封装了 lock 和
unlock 函数; 不定长参数 ...
分类:
其他好文 时间:
2014-05-16 04:26:20
阅读次数:
321
for变量in列表;do语句1语句2done列表的生成逐个给出如/etc/inittab/etc/使用通配符如forfilein/var/*使用命令如forfilein`ls/var`数字序列{起始数字..结束数字}如{1..100}或者`seq起始步长步长结束步长`使用for循环遍历目录#!/bin/bash
#version:0.1
#author:ml
#pragram:this..
分类:
其他好文 时间:
2014-05-15 12:40:38
阅读次数:
280
1.为什么使用循环结构? 主要解决代码重复使用时的多次书写。2.循环有些?
java循环有while for do...while foreach四种3.while 循环条件和循环体是循环的两个关键。
循环条件都市boolean类型的表达式。循环条件成立,则执行循环体,循环体执行结束,再判断条件,如...
分类:
编程语言 时间:
2014-05-15 09:45:01
阅读次数:
271
由于现网有时候要测试很多端口的连通性,所以就写了个小脚本,实现批量测试将telnet成功的写入到telnet_alive.txt中,失败则写入telnet_die.txt中#!/bin/bash#thisscripttestUPtootherhost.#Iplist=/opt/script_test/iplist.dataPortnumber=7001foripin$(catiplist.data)do(slee..
分类:
Web程序 时间:
2014-05-15 08:46:11
阅读次数:
385
window.document.onkeydown = disableRefresh;
function disableRefresh(evt){
evt = (evt) ? evt : window.event
if (evt.keyCode) {
if(evt.keyCode == 116){
//do something
}
}
}
keycode 8...
分类:
Web程序 时间:
2014-05-15 06:08:18
阅读次数:
315
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3682
E - Cup 3
Time Limit: 3 Seconds Memory Limit: 65536 KB
The 2012 Europe Cup was over and Spain won the Champio...
分类:
其他好文 时间:
2014-05-15 03:30:08
阅读次数:
370
插入排序是最基本基于比较的排序方法,其时间复杂度为Ο(n2),最好情况为初始有序,最坏为逆序。
伪代码如下: insertionSort(A,n) for i=1 to n do key=A[i] for j=i-1 to 0 if ar...
分类:
其他好文 时间:
2014-05-14 22:35:28
阅读次数:
326
【题目】
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be s...
分类:
其他好文 时间:
2014-05-14 21:00:57
阅读次数:
304
【题目】
Determine whether an integer is a palindrome. Do this without extra space.
【题意】
题意判断一个整数是否是回文数
注意一下几点:
1. 不能用额外的空间
2. 负数不是回文数...
分类:
其他好文 时间:
2014-05-14 20:31:10
阅读次数:
298
出现no write has been done on this connection解决方案...
分类:
数据库 时间:
2014-05-14 19:42:51
阅读次数:
403