public class Solution { public int findPeakElement(int[] nums) { if (nums == null || nums.length == 0 || nums.length == 1) { retu...
分类:
其他好文 时间:
2015-05-19 12:39:23
阅读次数:
80
public class Solution { public void setZeroes(int[][] matrix) { if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { ...
分类:
其他好文 时间:
2015-05-19 12:33:50
阅读次数:
134
在Hello窗口示例中添加:1.当鼠标左键按下时,由窗口左上方向右下方画一条线; 2.当鼠标左键松开时,由窗口左下方向右上方画一条线。// Hello.h 1 class CMyApp : public CWinApp 2 { 3 public: 4 virtual BOOL...
分类:
编程语言 时间:
2015-05-19 12:32:50
阅读次数:
128
public class LabelJob{ public static void main(String[] args) throws Exception { Job job = Job.getInstance(new Configuration()...
分类:
其他好文 时间:
2015-05-19 12:32:21
阅读次数:
191
public class Solution { public int findMin(int[] nums) { if (nums == null || nums.length == 0) { return 0; } int re...
分类:
其他好文 时间:
2015-05-19 12:31:53
阅读次数:
139
感觉自己代码写的有点复杂,不过好歹是通过了,接下来需要慢慢的把代码写简洁点,通用点。class Solution {private: vector> res; vector temp;public: void combinationSum(vector& candidates, i...
分类:
其他好文 时间:
2015-05-19 12:14:28
阅读次数:
83
大数快速开方!
import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
BigInteger...
分类:
其他好文 时间:
2015-05-19 10:50:23
阅读次数:
127
众所周知,C++类实现函数重载有两种情况:函数参数的类型不同,参数的个数不同。而与函数的返回值没有什么关系。还有一种类成员函数重载,它并不要求函数的参数类型不同。下面给出例子:
#include
using namespace std;
class A
{
public:
A(int a):_a(a){}
void print()const//函数体中不能修改数据成员对象,否...
分类:
编程语言 时间:
2015-05-19 10:49:40
阅读次数:
93
//C++类转换构造函数和转换函数复习
#include
#include
using namespace std;
class Student
{
private:
string name;
int age;
double grade;
public:
Student(string name_, int age_, doubl...
分类:
编程语言 时间:
2015-05-19 10:46:21
阅读次数:
125
整理的比较容易理解的PDO操作实例,注意,需要开启php的pdo支持,php5.1以上版本支持实现数据库连接单例化,有三要素 静态变量、静态实例化方法、私有构造函数 DPDO.php
//PDO操作类
//author http://www.lai18.com
class DPDO{
private $DSN;
private $DBUser;
private $DBPwd;
p...
分类:
数据库 时间:
2015-05-19 10:40:35
阅读次数:
135