8 ojshilu

尚未进行身份认证

https://github.com/lucky521

等级
TA的排名 4k+

Euler: Integer right triangles

If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. {20,48,52}, {24,45,51}, {30,40,50}p是三边长度均为整数的直角三角形的周长,当p=120时,存在三种直角三

2015-05-13 20:27:41

学习JavaScript的闭包

从外部访问函数局部变量变量有局部变量和全局变量。对于函数的局部变量,在函数内部可以访问,在函数外部无法访问。对于全局变量,在函数内部和外部都可以访问。闭包是什么?Javascript允许在函数中定义内部函数,将内部函数返回,这时候会产生闭包。 闭包中含有一种特殊的局部变量,在函数结束返回后仍然存在。 闭包中的局部变量是引用而不是拷贝。返回内部函数function makeFunc() { v

2015-05-12 21:36:15

Leetcode: Department Highest Salary

The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+—-+——-+——–+————–+ | Id | Name | Salary | DepartmentId | +—-+——-+——–+————

2015-03-19 18:10:41

Euler: Non-abundant sums

ProblemA perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which me

2015-03-18 23:05:45

Leetcode: Rank Scores

Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. I

2015-03-18 21:59:05

Leetcode: Consecutive Numbers

WriteaSQLquerytofindallnumbersthatappearatleastthreetimesconsecutively.+—-+—–+|Id|Num|+—-+—–+|1|1||2|1||3|1||4|2||5|1||6|2|

2015-03-16 22:20:32

Leetcode : Customers Who Never Order

Now we’ve got two table. One customer table for customerid and their names, One Order tablefor customers’ Id that bought something. We will find the customers that in the customer table but not in ord

2015-03-15 22:43:40

Leetcode: find all duplicate

Leetcode : Duplicate EmailsWrite a SQL query to find all duplicate emails in a table named Person. +—-+———+ | Id | Email | +—-+———+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +—-+———+

2015-03-15 22:27:45

Leetcode: 相关子查询

Leetcode : Employees Earning More Than Their Managers+—-+——-+——–+———–+ | Id | Name | Salary | ManagerId | +—-+——-+——–+———–+ | 1 | Joe | 70000 | 3 | | 2 | Henry | 80000 | 4 |

2015-03-14 19:01:44

Leetcode: Second Highest Salary

Write a SQL query to get the second highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given the abov

2015-03-14 00:00:58

Euler: Digit fifth powers

Problem 30: Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:1634 = 1^4 + 6^4 + 3^4 + 4^4 8208 = 8^4 + 2^4 + 0^4 + 8^4 9474 = 9^4 + 4^4 + 7^4

2015-03-12 19:54:15

Euler: Counting Sundays

Problem 19. You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September, April, June and November. All the rest hav

2015-03-11 21:07:22

Euler: Names scores

Problem 22: Using names.txt, a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this

2015-03-10 22:51:31

Euler: Amicable numbers

Amicable numbersThis is the 21st issue of Euler Project Challenge Game.Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).

2015-03-09 19:03:21

Leetcode:Excel Sheet Column Number

Leetcode增加了Accepted Solutions Runtime Distribution,能够看到自己的代码的效率和别人比起来在怎么样的位子。CSDN博客终于推出了Markdown格式写博客。

2015-03-09 17:27:30

数组的最大子数组积 Maximum Product Subarray

题目:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the large

2014-10-20 10:40:24

寻找循环有序数组的最小值 Find Minimum in Rotated Sorted Array

二分查找是典型的分治思想,主要应用于有序顺组相关的查找问题。典型

2014-10-20 10:14:02

Hadoop系统的守护进程

Hadoop系统在启动有有五个重要的JVM进程,分别是

2014-09-19 16:40:21

看看进程、线程的父子关系

主线程调用pthread_join来等待子线程的结束,然后去ch

2014-09-16 18:52:01

printf趣味程序

下面这个单行程序里包含了不少知识:main() { printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}1:unix默认值main(){ printf(“%d”, unix); }2:数组表示法数组的表示法:str[n]   等价于  (n)[str] ,等价于 str + n,就

2014-08-29 13:48:17

查看更多

勋章 我的勋章
  • 专栏达人
    专栏达人
    授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!