An iterative way of writing quick sort:
#include
#include
#include
using namespace std;
void quickSort(int A[], int n) {
stack> stk;
stk.push(make_pair(0, n-1));
while (!stk.empty()) {
pair ...
分类:
其他好文 时间:
2014-06-03 00:16:43
阅读次数:
357
git提交代码时,出现这个错误“error: The requested URL returned error: 403 Forbidden while accessing https”
解决方法:
编辑.git目录下的config文件即可。
vim .git/config
#修改对于的配置
#原来的url = https://github.com/elitecodegr...
分类:
数据库 时间:
2014-06-03 00:03:44
阅读次数:
349
阻塞IO实现:
public class PlainEchoServer {
public void serve(int port) throws IOException {
final ServerSocket socket = new ServerSocket(port);
try {
while (true) {
final Socket clientSocket...
分类:
其他好文 时间:
2014-06-02 23:32:20
阅读次数:
357
#include#includeusing namespace std;int main(){ int
len; while(cin>>len) { int ans; len--; cin>>ans; while(len--) { int
a; cin>>a; ...
分类:
其他好文 时间:
2014-06-02 19:59:57
阅读次数:
190
importjava.util.Scanner;
publicclassA04{
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("欢迎使用MyShopPing管理系统");
System.out.println("\n********************************..
分类:
编程语言 时间:
2014-06-02 14:44:48
阅读次数:
378
安装系统从光盘启动报错:出现黑屏,并且有一个提示框imagefailed to verify with
*access denied*press any key to
continue原因:三星笔记本对系统有降级保护,在将win8改装为win7是,需要设置bios。1.开机按F2 进入bios,找....
分类:
数据库 时间:
2014-06-02 06:32:46
阅读次数:
3850
问题:
返回N皇后问题解的个数。
分析:
详见 N-queens
实现:
bool nextPermutation(vector &num)
{
int i = num.size() - 1;
while (i >= 1)
{
if(num[i] > num[i - 1])
{
--i;
int ii = num.size() - 1;
while (i...
分类:
其他好文 时间:
2014-06-01 18:24:45
阅读次数:
398
就如同C里的if else,while,do,repeat;就看lua里怎么用:
1、首先看if else
t = {1,2,3}
local i = 1
if t[i] and t[i] % 2 == 0 then
print("even")
else
print("odd")
end
lua木有C里的&&,而是and来表示;if 之后跟表达式,之后要更个then 最后语句结束都要...
分类:
其他好文 时间:
2014-06-01 18:13:48
阅读次数:
567
importjava.util.Scanner;
publicclassA03{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("****************************************");
System.out.print..
分类:
编程语言 时间:
2014-06-01 16:42:08
阅读次数:
335
publicclassA01{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
intsum=0;
intnum=2;
while(num<=100){
sum+=num;
num+=2;
}
System.out.println(sum);
}
}
分类:
编程语言 时间:
2014-06-01 16:35:36
阅读次数:
552