Skip to content

Instantly share code, notes, and snippets.

/*交换a,b的值*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
//函数的声明<br/>
int change_1(int a,int b);
int change_2(int *pa,int *pb);
int change_3(int &a,int &b);
int main()
{
@misakar
misakar / test1.cpp
Last active August 29, 2015 14:22
C语言函数问题
/***
* C语言函数的传值调用与传址调用
*/
# include<stdio.h>
# include<stdlib.h>
# include<conio.h>
int test1(int a,int b);
int test2(int *pa,int *pb);
int test3(int &a,int &b);
@misakar
misakar / hanoi.cpp
Created May 28, 2015 09:28
汉洛塔问题
/***
*
* 汉诺塔问题
* |-- n=1 move(A,C)
* hanoi(n,A,B,C)-|-- n>1 hanoi(n-1,A,C,B)
* | move(A,C)
* hanoi(n-1,B,A,C)
*/
# include<stdlib.h>
# include<stdio.h>

木犀Web组的目标,是培养全面的工程师,甚至是无所不能的全栈工程师,当然大家离这个目标还很远。 首先在毕业之前,我们要深入一个方面,好好学习,有一技之长。对于web中的其他方面,要有一个感性的认识,也就是有实际的操作。 对于自己的专业方向,要了解原理,这样学其他的技术也会比较轻松。 在以后的工作中,一直学习,保持对新技术的热情和对打造优美软件的追求,未来就是你的。

当然最重要的是要享受这个过程,编程就像魔法一样,这不是很神奇吗?

##预备工作

###1.在踏上Web开发的征途之前,挑一件趁手的兵器吧

00000000 78 03 00 4d 53 57 49 4e 34 2e 31 00 02 08 2a 00 |x..MSWIN4.1...*.|
00000010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 08 00 00 |........?.......|
00000020 00 f8 0f 00 fd 03 00 00 00 00 00 00 01 01 00 00 |................|
00000030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 80 00 29 d0 3f 17 96 4e 4f 20 4e 41 4d 45 20 20 |..).?..NO NAME |
00000050 20 20 46 41 54 33 32 20 20 20 00 00 00 00 00 00 | FAT32 ......|
00000060 00 00 00 00 00 00 00 00 60 55 b1 77 35 7f 00 00 |........`U.w5...|
00000070 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080 00 00 00 00 00 00 00 00 f0 33 00 60 35 7f 00 00 |.........3.`5...|
00000090 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 |................|
@misakar
misakar / tree.md
Created February 17, 2016 14:57 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@misakar
misakar / tree.md
Created February 17, 2016 14:57 — forked from upsuper/tree.md
一行 Python 实现树

一行 Python 实现树

使用 Python 内置的 defaultdict,我们可以很容易的定义一个树形数据结构:

def tree(): return defaultdict(tree)

就是这样!

@misakar
misakar / pytz_patch.py
Created June 12, 2016 14:03 — forked from Xion/pytz_patch.py
Patching pytz with import hook to have usable generic timezones
"""
Import hook extending pytz package with usable, generic timezones:
GMT-14 up to GMT+12.
Note that pytz already has Etc/GMT+X timezones, but
(quoting Wikipedia):
"In order to conform with the POSIX style, those zones beginning with "Etc/GMT"
have their sign reversed from what most people expect. In this style,
zones west of GMT have a positive sign and those east have a negative sign."
# coding: utf-8
"""
array to bst
"""
class BSTNode(object):
"""BST 维护的节点结构"""
def __init__(self, key, lnode=None, rnode=None):
self.key = key # 节点值
def handle(real_inputs, sort_inputs, output):
index = 0
while (index != n):
if (real_inputs[index] == sort_inputs[index]):
output.append(real_inputs[index])
index += 1
else: index = sort_inputs.index(real_inputs[index])+1
if __name__ == '__main__':
#n = input()