本文通过python 来实现这样一个简单的爬虫功能,把我们想要的图片爬取到本地。...
分类:
编程语言 时间:
2014-05-15 15:09:46
阅读次数:
450
前面提到过很多次大整数的问题,这个是真正的大整数。
我用了一个很蠢得方法,先写一个大整数和一个个位数相乘的方法,返回的结果是一个string,然后写一个string相加的方法,每次循环,用其中一个数的每一位去乘另一个数,然后加到结果上。。
多么愚蠢的思路,居然还一遍过了。。一个更好的方法是先用两个int数组把两个string存一下,每位占数组中的一个数,然后再用一个int数组保存结果,每次也是...
分类:
其他好文 时间:
2014-05-15 14:55:51
阅读次数:
322
test
// alert(jQuery());
function print(string){
document.write(string+"");
};
document.write("********无返回值的情况***************");
(function(){
var jq = (function(){
var jq = fun...
分类:
编程语言 时间:
2014-05-15 11:14:55
阅读次数:
373
1.HashMap的遍历
package com.sheepmu;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
public class KMPText
{
public static void main(String[] ar...
分类:
其他好文 时间:
2014-05-15 07:05:19
阅读次数:
507
序列-2
序列相加
通过加号对列表进行连接操作;
列表
>>> [1,3,4]+[2,5,8]
[1, 3, 4, 2, 5, 8]
字符串
>>> '134'+'258'
'134258'
元组
>>> (1,2,3)+(2,5,8)
(1, 2, 3, 2, 5, 8)
元素数据类型不同的列表
>>> [[1,3],[3,9]]+[[2,2],'abc']
[[1,...
分类:
编程语言 时间:
2014-05-15 05:31:56
阅读次数:
425
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be specifi...
分类:
其他好文 时间:
2014-05-15 05:00:50
阅读次数:
229
#include
#include
using namespace std;
class Teacher
{
public:
Teacher(string nam,int ag,char s,string ad,int num,string t)
{
name=nam;
age=ag;
sex=s;
...
分类:
其他好文 时间:
2014-05-15 04:32:56
阅读次数:
262
水题。
描述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符加入到这一轮的字符串中就可以了。
class Solution {
public:
string countAndSay(int n) {
if(n == 0) return "";
...
分类:
其他好文 时间:
2014-05-15 04:12:07
阅读次数:
289
【题目】
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
【题意】
题意是找出字符串S中最长回文子串,S最长为1000,保证有唯一解
【思路】
原字符串用特殊字符#间隔,如下所示:
#a...
分类:
其他好文 时间:
2014-05-15 03:31:25
阅读次数:
299
原文:
1.5 Write a method to replace all spaces in a string with ‘%20’.
译文:
写一个函数,把字符串中所有的空格替换为%20 。...
分类:
其他好文 时间:
2014-05-14 14:09:29
阅读次数:
310