#include
void change_array(int *p, int len)
{
if (p == NULL || len == 0)
return;
int *begin = p;
int *end = p + len - 1;
while (begin < end)
{
while ((begin < end) && ((*begin%2)!=0))
begi...
分类:
编程语言 时间:
2015-06-15 20:33:33
阅读次数:
232
题目:
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.解答:class Solution {
public:
int trailingZeroes(int n) {
int...
分类:
其他好文 时间:
2015-06-15 20:33:08
阅读次数:
119
用svn client的时候出现这么一个问题,客户端能正常check out,但是在check in(commit,mkdir等)的时候出错了:Server sent unexpected return value (403 Forbidden) in response to MKACTIVITY服...
分类:
其他好文 时间:
2015-06-15 20:31:29
阅读次数:
111
(function($){
var ms = {
init:function(obj,args){
return (function(){
ms.fillHtml(obj,args);
ms.bindEvent(obj,args);
})();
},
//填充html
fillHtml:function(obj,args){
return (function(){
obj.e...
分类:
Web程序 时间:
2015-06-15 18:43:28
阅读次数:
146
angular.module('myApp', []) .directive('myDirective', function() { return { restrict: 'A', replace: true, scope: { ...
分类:
Web程序 时间:
2015-06-15 18:36:54
阅读次数:
129
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr...
分类:
编程语言 时间:
2015-06-15 18:34:55
阅读次数:
1218
以下两段程序的输出是什么?程序1:#include "stdio.h"class Base { public: int Bar(char x) { return (int)(x); } virtual int Bar(int x) { ...
分类:
编程语言 时间:
2015-06-15 18:27:25
阅读次数:
1304
问题描述:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321输入一个整形数字,然后输出它的反转需要注意的是,int形变量的反转有可能是超过int的限制的,比如123456789...
分类:
其他好文 时间:
2015-06-15 18:27:14
阅读次数:
105
Add Binary: https://leetcode.com/problems/add-binary/Given two binary strings, return their sum (also a binary string).For example,
a = “11”
b = “1”
Return “100”.本题关键点在于:
1. 从后往前计算,但是结果字符串应该是从最前插入每...
分类:
其他好文 时间:
2015-06-15 16:25:15
阅读次数:
113
题目:
输入一个正数s,打印出所有和为S的连续正数序列(至少含有两个数)。例如输入15,由于1+2+3+4+5=4+5+6=7+8=15,所以打印出三个结果。void FindContinuousSequence(int sum)
{
if(sum < 3)
return; int small = 1;
int big = 2;
int middle...
分类:
其他好文 时间:
2015-06-15 16:24:37
阅读次数:
102