- 博客(6)
- 收藏
- 关注
原创 统计2016政府工作报告中的高频词
# -*- coding: utf-8 -*-、''' 统计2016政府工作报告中的高频词'''import jiebaimport requestsfrom bs4 import BeautifulSoup''' 从网上抓取政府工作报告的全文 extract_text(url)'''def extract_text(url): #page_source
2016-03-08 15:35:03 1037
转载 C++宏定义详解
一、#define的基本用法 #define是C语言中提供的宏定义命令,其主要目的是为程序员在编程时提供一定的方便,并能在一定程度上提高程序的运行效率,但学生在学习时往往不能 理解该命令的本质,总是在此处产生一些困惑,在编程时误用该命令,使得程序的运行与预期的目的不一致,或者在读别人写的程序时,把运行结果理解错误,这对 C语言的学习很不利。1 #define命令剖析1
2016-02-23 16:14:07 254
原创 Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe
2015-10-13 21:11:33 234
原创 Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you
2015-10-13 20:44:44 230
原创 使用递归求一个数分解质因数
#include stdio.h>void fenjie_zhiyinshu(int number){ int i,j; for (i = 2; i = number; i++) { if (number % i == 0) { j = number / i; if (j
2015-09-17 09:53:16 1535
转载 Python正则表达式指南
1. 正则表达式基础1.1. 简单介绍正则表达式并不是Python的一部分。正则表达式是用于处理字符串的强大工具,拥有自己独特的语法以及一个独立的处理引擎,效率上可能不如str自带的方法,但功能十分强大。得益于这一点,在提供了正则表达式的语言里,正则表达式的语法都是一样的,区别只在于不同的编程语言实现支持的语法数量不同;但不用担心,不被支持的语法通常是不常用的部分。如果已经在其他语
2015-09-02 20:46:41 317
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人