• 摘要视图
  • 目录视图

所有文章列表

STL deque容器不支持通过指针偏移读取元素(cplusplus.com意见反馈)

问题反馈过程

http://www.cplusplus.com 是介绍标准c++语言的一个权威网站,在其对deque容器的介绍中,有这样一句(反馈后现已更改):

But, unlike vectors, deques are not guaranteed to store all its elem[……]

>> 阅读全文…

Python中一个正整数和一个负整数相除问题(易错点)

针对Python 2.7 版本,Python3 中不存在该问题

下面这段代码输出结果是什么?

a = 1
b = -2
c = a / b
print c
print int(c)
print int(-0.5)

输出结果为:-1, -1, 0

如果是在C++中

int a = 1;
int[......]

>> 阅读全文...

类对象数组的初始化与赋值(易错点)

下述代码中声明类Example对象的数组e[2],然后新建了Example(1)对象并赋值给e[0]。通过这种方式设置类对象数组,称为赋值,而不是初始化。

这个过程实际上赋值过程,存在临时对象Example(1)的构造和析构。而通过类对象数组初始化就不存在生成临时对象这一过程。先看类对象数组声明和赋[……]

>> 阅读全文…

Problem 49 Prime permutations

Problem 49: Prime permutations

https://projecteuler.net/problem=49

The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases b[……]

>> 阅读全文…

Problem 48 Self powers

Problem 48: Self powers

https://projecteuler.net/problem=48

The series, 11 + 22 + 33 + … + 1010 = 10405071317.

Find the last ten digits of the ser[……]

>> 阅读全文…

Problem 47 Distinct primes factors

Problem 47: Distinct primes factors

https://projecteuler.net/problem=47

The first two consecutive numbers to have two distinct prime factors are:

14[……]

>> 阅读全文…

Problem 46 Goldbach’s other conjecture

Problem 46: Goldbach’s other conjecture

https://projecteuler.net/problem=46

It was proposed by Christian Goldbach that every odd composite number ca[……]

>> 阅读全文…

Problem 45 Triangular, pentagonal, and hexagonal

Problem 45: Triangular, pentagonal, and hexagonal

https://projecteuler.net/problem=45

Triangle, pentagonal, and hexagonal numbers are generated by t[……]

>> 阅读全文…

Problem 43 Sub-string divisibility

Problem 43: Sub-string divisibility

https://projecteuler.net/problem=43

The number, 1406357289, is a 0 to 9 pandigital number because it is made up[……]

>> 阅读全文…

Problem 42 Coded triangle numbers

Problem 42: Coded triangle numbers

https://projecteuler.net/problem=42

The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); s[……]

>> 阅读全文…

Problem 41 Pandigital prime

Problem 41: Pandigital prime

https://projecteuler.net/problem=41

We shall say that an n-digit number is pandigital if it makes use of all the digits[……]

>> 阅读全文…

Problem 40 Champernowne’s constant

Problem 40: Champernowne’s constant

https://projecteuler.net/problem=40

An irrational decimal fraction is created by concatenating the positive inte[……]

>> 阅读全文…

Problem 39 Integer right triangles

Problem 39: Integer right triangles

https://projecteuler.net/problem=39

If p is the perimeter of a right angle triangle with integral length sides,[……]

>> 阅读全文…

Problem 38 Pandigital multiples

Problem 38: Pandigital multiples

https://projecteuler.net/problem=38

Take the number 192 and multiply it by each of 1, 2, and 3:

192 × 1 = 192
192 ×[……]

>> 阅读全文…

Problem 37 Truncatable primes

Problem 37: Truncatable primes

https://projecteuler.net/problem=37

The number 3797 has an interesting property. Being prime itself, it is possible t[……]

>> 阅读全文…