贵灯提供的简单打印函数,非原创; 注意: do{}while(false); 的使用(内部多个判断,用
do false 中的 break 可以避免使用 if true 引起的嵌套层数过多); 关键段 CRITICAL_SECTION 的使用,封装了 lock 和
unlock 函数; 不定长参数 ...
分类:
其他好文 时间:
2014-05-16 04:26:20
阅读次数:
321
第四道树题,逐渐能写递归了。虽然最后AC的代码还是看了网络,但是距离成功攻克此类问题仅一步之遥。题目:一棵树,判断是否为AVL。(AVL条件:树上任意一点的左右子树的高度差_
1 ) return false; else return isBalanced(root.lef...
分类:
其他好文 时间:
2014-05-16 04:04:41
阅读次数:
259
if (IS_IOS7()) { /* iOS7 时 Navigation 颜色 */
[[UINavigationBar appearance] setBarTintColor: HexColor(0x7bae01)]; } else { ...
分类:
其他好文 时间:
2014-05-16 03:42:25
阅读次数:
359
#!/bin/bash
#
Count=0
forUserNamein$@;do
ifid$UserName&>/dev/null;then
echo"$UserNameexists."
else
useradd$UserName
echo"Add$UserNamesuccessfully."
Count=$[$Count+1]
fi
done
echo"Add$Countnewusers."
分类:
其他好文 时间:
2014-05-15 18:52:21
阅读次数:
214
PHP生成指定大小随机图片 $image_width){ for ($i=$start;
$i<$image_height * 2; $i+=$step) { imageline($img, 0, $i, $i, 0,
$color); }}else{ for ($i=$start; $i<$im....
分类:
Web程序 时间:
2014-05-15 17:42:03
阅读次数:
377
1、if,else,elseif语法:<#ifcondition>...<#elseifcondition2>...<#elseifcondition3>......<#else>...</#if>备注:condition、condition2···必须为boolean类型,<#elseif··>、<#else>可有0或多个。实例:<#ifx==1>xis1..
分类:
其他好文 时间:
2014-05-15 12:33:22
阅读次数:
385
JavaScript是区分大小写的:也就是说,关键字、变量、函数名、和所有的标识符都必须采用一致的大小写(一般我们都是写成小写的),这样和当初学C#的多样式写法有很大的区别。比如:关键字:”while”必须小写(写成”while”)而不能写成”While”或者”WHILE”。但要我们应该注意的是:在...
分类:
编程语言 时间:
2014-05-15 10:42:30
阅读次数:
400
1.为什么使用循环结构? 主要解决代码重复使用时的多次书写。2.循环有些?
java循环有while for do...while foreach四种3.while 循环条件和循环体是循环的两个关键。
循环条件都市boolean类型的表达式。循环条件成立,则执行循环体,循环体执行结束,再判断条件,如...
分类:
编程语言 时间:
2014-05-15 09:45:01
阅读次数:
271
#include
#include
#include
#include
using namespace std;
#ifdef ONLINE_JUDGE
#define FINPUT(file) 0
#define FOUTPUT(file) 0
#else ...
分类:
其他好文 时间:
2014-05-15 06:27:05
阅读次数:
230
#include int main(int argc, char *argv[]){ int
c = -1, n = -1; while (true) { scanf("%d%d",&c,&n); int
arr[n],sum[n],b[n]; if (c + n == 0) { ...
分类:
其他好文 时间:
2014-05-14 23:11:50
阅读次数:
391