#include "stdafx.h"#include #include #include using namespace std;void print(int numbers[], int size){ for (int i = 0; i = high) return; const i...
分类:
其他好文 时间:
2014-08-29 19:41:48
阅读次数:
263
USE [AdventureWorks2012]goIF object_id('USP_GENERATEDML') IS NOT NULLBEGIN PRINT 'Dropping procedure USP_GENERATEDML' DROP PROCEDURE [USP_GENER...
分类:
数据库 时间:
2014-08-29 12:38:48
阅读次数:
313
下面几个比较能说明原因的解释是:表示{}里面的是一个变量 ,执行时按照变量来处理在字符串中引用变量使用的特殊包括方式,这样就可以不使用.运算符,从而减少代码的输入量了。其实输出那块是等同于print "hello ".$arr['fruit'];PHP: 字符串变量中大括号(花括号{})的作用P.....
分类:
Web程序 时间:
2014-08-29 09:25:27
阅读次数:
213
1.一个简单的无参函数
#!/usr/bin/evnpython
#filename:function1.py
defsayHello():
print‘HelloWorld!‘
sayHello()
2.函数传参
#!/usr/bin/evnpyhon
#Filename:fun_param.py
defprintMax(a,b):
ifa>b:
printa,‘ismaxinum‘
else:
printb,‘ismaxinum‘
printMax(3,4)
x=5..
分类:
编程语言 时间:
2014-08-29 03:05:47
阅读次数:
283
1.for循环
#!/usr/bin/evnpython
#Filename:for.py
foriinrange(1,5):
printi
else:
print‘Theforloopisover‘
2.break语句
#!/usr/bin/evnpython
#filename:break.py
whileTrue:
s=raw_input(‘Entersomething:‘)
ifs==‘quit‘:
break
print‘Lengthofthestringis‘,len(s)
prin..
分类:
编程语言 时间:
2014-08-29 03:05:27
阅读次数:
230
panic 抛出异常 recover 捕获异常 捕获后会返回外层函数继续执行 defer 函数退出之前执行 func panicOut() { print(5) panic("error") print(6) } func recoverHere() { print(3) defer func(){ err := recover(...
分类:
编程语言 时间:
2014-08-28 16:23:10
阅读次数:
208
static int* Min;
static int* Max;
void LeastCoin2(int* Value, int Len, int *d, int Goal)
{
for(int i = 1; i <= Goal; i++)
{
for(int j = 0; j = Value[j])
...
分类:
其他好文 时间:
2014-08-28 16:18:49
阅读次数:
216
这种洗牌方式的算法:
1:初始化一个长度为54的数组,和54张牌。
2:从i=1开始到54,每次从剩余的牌堆中随机抽一张牌放到数组的i下标下。
这样我们可以用一个数组做也可以用两个数组做。
就和经典的选择排序一样。
#include
#include
#include
#include
#include
#include
#define POKER_NUM 54
int poker[54...
分类:
编程语言 时间:
2014-08-28 13:23:09
阅读次数:
393
目前lua最新版本,5.2.3。
此例为一个简单的lua解析器,源码摘自《Lua游戏开发实践指南》。
测试例程功能为:解析简单的lua指令,如:print("Hello world!");
function fun(x ,y) return x + y end
z =fun(1,1);
print(z);
结果如下图:
源码如下:
simple_main.cpp:
...
分类:
其他好文 时间:
2014-08-28 11:31:09
阅读次数:
362