普通排序:直接分配一个同等大小的数组,反向copy即可.char* Reverse(char*
s){ //将q指向字符串最后一个字符 char* q = s ; while( *q++ ) ; q -= 2 ; //分配空间,存储逆序后的字符串。
char* p = newchar[sizeof(...
分类:
其他好文 时间:
2014-05-12 16:30:14
阅读次数:
338
前面已经说过选择结构了其实他和for相差不是太大,现在就来说说循环结构。循环结构有三种形式!1
for 2.while 3.do while 这三种都可以循环,不过他们之间还是有区别的,for和while是要先验证条件,如果条件满足才执行循环体,而后者do
while是不管条件是否满足都要执...
分类:
其他好文 时间:
2014-05-10 20:03:50
阅读次数:
326
Android 加载项目失败: sdk/build-tools/android-4.4.2/aapt:
error while loading shared libraries: libz.so.1: cannot open shared object file:
No such file or ....
分类:
移动开发 时间:
2014-05-06 09:19:19
阅读次数:
418
1)循环语句while,do/while,for
格式:while(布尔表达式){循环体语句}//先验循环,可执行0次或n次,若布尔表达式第一次为false,永不执行循环体语句
do{循环体语句}while(布尔表达式);//后验循环,可执行一次或n次,且至少执行一次 for(初始化;布尔表达式;变...
分类:
其他好文 时间:
2014-05-06 09:15:17
阅读次数:
254
sed‘s/^/\//g‘4行首增加指定字符提取网页中的播放地址:#!/bin/bash
printf"enteryourdir:"
readdir
echo"$dirisxx"
cd$dir
echo`pwd`
forfilein`ls.`
do
if[-d$file];then
echo$file
cd$file
echo`pwd`
tree`pwd`|grepplay|sed‘s/.*//g‘>11
tree`pwd`|grepplay|sed‘s/.*//g..
分类:
其他好文 时间:
2014-05-03 00:53:15
阅读次数:
336
一,socket 模块
套接字包括两类:服务器,客户机,
创建一个套接字后让它等待连接
服务器:
import socket
s = socket.socket()
port = 1234
host = socket.gethostname()
print host
s.bind((host,port))
s.listen(5)
while True:
get,addr = s...
分类:
编程语言 时间:
2014-05-02 21:59:57
阅读次数:
444
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3749
Chameleon
Time Limit: 6 Seconds Memory Limit: 65536 KB
Given n groups of integers(all the integers are distin...
分类:
其他好文 时间:
2014-05-02 19:06:34
阅读次数:
447
“参考Lua游戏开发实践指南”
Lua提供两种控制结构(数字型和通用型)--Lua中的for语句的索引是从1开始的 数字型: 一个简单的示例如下1 for indx = 1, 10 do2
print(indx)3 end do关键字标记程序块的开始,end标记程序块的结束。 ...
分类:
其他好文 时间:
2014-05-02 17:26:51
阅读次数:
702
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-05-02 09:10:46
阅读次数:
252
- (void)viewDidLoad{ [super viewDidLoad]; // Do any
additional setup after loading the view, typically from a nib. [NSThread
sleepForTimeInte...
分类:
移动开发 时间:
2014-05-02 00:25:42
阅读次数:
441