void run(int n)
{
int m = n;
}
int main()
{
run(1000);
return 0;
}
08048374 :
8048374: 55
push %ebp
8048375: 89 e5
mov %esp,%ebp
804...
分类:
其他好文 时间:
2014-06-05 01:01:20
阅读次数:
248
【题目】
Implement int sqrt(int x).
Compute and return the square root of x.
【题意】
实现 int sqrt(int x),计算并返回平方根。
【思路】
用牛队迭代法求解,本题可以转化为求 f(n)=n^2-x=0的解
用牛顿迭代法不断逼近真实解,假设曲线上有点(n[i],f(n[i]))
则这点出的斜率为2ni, 通过该点的直线方程为 y=2n[i](...
分类:
其他好文 时间:
2014-06-04 23:38:20
阅读次数:
325
/**
* 采用httpclientPost请求的方式
*
* @param username
* @param password
* @return null表示求得的路径有问题,text返回请求得到的数据
*/
public static String httpclientPost(String username, String password) {
try ...
分类:
移动开发 时间:
2014-06-03 05:34:33
阅读次数:
222
/**
* 采用post请求的方式
*
* @param username
* @param password
* @return null表示求得的路径有问题,text返回请求得到的数据
*/
public static String postRequest(String username, String password) {
try {
String p...
分类:
移动开发 时间:
2014-06-03 04:57:53
阅读次数:
263
【题目】
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
【题意】
给定一个已排序的链表,删除其中的重复元素
【思路】
维护两个指针prev和cur, cur指针负责扫描链表,prev指向cur的前一...
分类:
其他好文 时间:
2014-06-03 04:05:39
阅读次数:
231
1.互满数
#include
#include
int fun(int n);
int main(void)
{
int x, y;
for(x = 1; x
{
for(y = 1; y
{
if(fun(x) == y && fun(y) == x)
printf("%d %d\t", x, y);
}
}
return 0;
}
...
分类:
编程语言 时间:
2014-06-03 03:28:21
阅读次数:
274
/**
* 采用httpclientGet请求的方式
*
* @param username
* @param password
* @return null表示求得的路径有问题,text返回请求得到的数据
*/
public static String httpclientGet(String username, String password) {
try {
...
分类:
移动开发 时间:
2014-06-03 02:22:25
阅读次数:
189
【题目】
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
【题意】
给定一个有序链表,删出其中重复出现的值...
分类:
其他好文 时间:
2014-05-31 21:14:11
阅读次数:
333
题目一:CombinationsGiven two integersnandk, return all
possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a
solution is:[ [2,4],....
分类:
其他好文 时间:
2014-05-31 20:01:02
阅读次数:
455
C# yeild的两种形式的yield语句:yield return ;yield break; 使用
yield return 语句每一次返回每个元素。 将使用 foreach 语句从客户端代码中调用迭代器。 foreach 循环的每次迭代都会调用迭代器方法。
迭代器方法运行到 yield...
分类:
其他好文 时间:
2014-05-31 20:00:25
阅读次数:
354