- 博客(17)
- 收藏
- 关注
原创 汉诺塔玩法解密(非代码)
附图地址:http://www.docin.com/p1-532193843.html在线玩网站:http://www.mathsisfun.com/games/towerofhanoi.html定义:借助针——非目的地 目的针——目的地 只要遵循两个规则。从下往上数,偶数个盘片要去到借助针,奇数个盘片要去到目的针。如图。...
2012-11-20 17:11:10
419
原创 输入输出c++
[code="c++"]int readFile(){ ifstream inFile("input.txt"); if (!inFile.is_open()) { cout > a[i++]; } n=i; inFile.close();}void writeFile(int nn,int nnn){ ofstream ou...
2012-10-15 20:58:57
100
原创 2b公交抓取程序,第一版(JAVA)
[code="java"]import java.io.IOException;import java.util.ArrayList;import java.util.List;import org.jsoup.Jsoup;import org.jsoup.nodes.Document;import org.jsoup.nodes.Element;import org....
2012-08-07 11:03:31
323
原创 JAVA里面的时间日期类的用法
[size=large]1、java.util.Date类型转换成long类型[/size][code="java"]java.util.Date dt = new Date();System.out.println(dt.toString()); //java.util.Date的含义long lSysTime1 = dt.getTime() / 1000; //得到秒数,D...
2012-08-07 10:57:07
101
原创 c++ 重载操作符(流输入输出)
[code="c++"]#include #include using namespace std;class MyClass {private: string name; int id; int prefix; int value;public: MyClass() { }; MyClass(string n, int a, int p, in...
2012-07-10 13:53:34
229
原创 std::find对容器内的东西进行查找,(查找基本类型,查找类类型)
查找最基本的类型[code="c++"]#include #include #include using namespace std;int main(){ list lst; lst.push_back(10); lst.push_back(20); lst.push_back(30); list::iter...
2012-07-09 15:44:38
467
原创 Boost::bind 测试代码
[code="c++"]#include#include#include#includeusing namespace boost;using namespace std;struct point{ int x,y; point(int a=0,int b=0):x(a),y(b){} void print(){ cout
2012-07-09 15:32:23
68
Boost::Shared_ptr初学
[code="c++"]#include "boost/shared_ptr.hpp"#include #include //boost的shared_ptr 是一种智能指针,//可以根据其被引用的次数进行智能释放,当被引用次数为0的时候自动释放,//这个功能和iphone上面编程,objective-c里的功能有所类似。class shared{...
2012-07-05 13:53:40
111
原创 测试Boost::program_options代码
[code="c++"]#include #include #include using namespace std;int main(int argc, char* argv[]){ // using namespace boost::program_options; //声明需要的选项 namespace po = boost::prog...
2012-07-04 13:35:32
172
初学boost::any的测试代码
[code="c++"]#include #include #include #include #include "boost/any.hpp"class A {public: void some_function() { std::cout some_function(); } el...
2012-07-03 10:22:43
113
原创 【iphone】开发视频教程2里面的代码
VideoProject2ViewController.h[code="c"]//// VideoProject2ViewController.h// VideoProject2//// Created by stu56 on 11-10-11.// Copyright 2011 __MyCompanyName__. All rights reserve...
2011-10-12 10:48:02
77
内牛满面的iphone 入门实验源代码(objective c)
.m文件[code="c"]//// Test1AppDelegate.m// Test1//// Created by stu42 on 11-9-23.// Copyright 2011 __MyCompanyName__. All rights reserved.//#import "Test1AppDelegate.h"@...
2011-10-10 10:02:42
94
原创 快速排序
[code="java"]public class Qiicc { static int a[] = { 5, 4, 1, 2, 4, 5, 7, 8, 9 }; public static void main(String args[]) { qSort(0, a.length-1); for (int i = 0; i < a.length; i...
2011-06-05 22:19:20
78
原创 Arrays提供的自动排序
[code="java"]import java.util.Arrays;public class TestSort { /** * @param args */ static int [] a = {4324,3,3,24,32,43,43,4,24,2}; public static void main(String[] args)...
2011-06-05 22:16:45
189
【输入输出】读取写入文件的常用代码
[code="java"]/** * 读取文件的函数 * * @param args */ public static boolean readFile() { try { Scanner input = new Scanner(new File("input.txt")); n = input.nextInt();...
2011-05-02 18:42:39
153
原创 【回溯法】最大团问题【递归方法】
[code="java"]/** * 5.7 最大团问题 G的最大团是指G中所含顶点数最多的团。 无向图的最大团和最大独立集问题都可以看作是图G的顶点集V的 子集选取问题可以用回溯法在O(n*(2^n))时间内解决。**********************************************************...
2011-04-19 22:41:51
869
8格骑士巡游的不完全回溯法
[code="java"].import java.util.Scanner;public class KnightSeemsRight { public static final int MAX_EXITS = 8; public static final int SIDE_LENGTH = 8; static int[][] board = new int[...
2011-04-16 10:05:13
272
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人