<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://wiki.tomtalk.net/index.php?action=history&amp;feed=atom&amp;title=%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0</id>
		<title>编程学习 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.tomtalk.net/index.php?action=history&amp;feed=atom&amp;title=%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0"/>
		<link rel="alternate" type="text/html" href="http://wiki.tomtalk.net/index.php?title=%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0&amp;action=history"/>
		<updated>2026-04-24T09:48:55Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>http://wiki.tomtalk.net/index.php?title=%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0&amp;diff=4565&amp;oldid=prev</id>
		<title>Tom：/* Growth of a Population */</title>
		<link rel="alternate" type="text/html" href="http://wiki.tomtalk.net/index.php?title=%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0&amp;diff=4565&amp;oldid=prev"/>
				<updated>2016-09-02T07:14:26Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Growth of a Population&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==sum of array==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function sumArray($array)&lt;br /&gt;
{&lt;br /&gt;
    sort($array);&lt;br /&gt;
    array_pop($array);&lt;br /&gt;
    array_shift($array);&lt;br /&gt;
    return array_sum($array);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function sumArray($array)&lt;br /&gt;
{&lt;br /&gt;
    return array_sum($array) - max($array) - min($array);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function sumArray($array)&lt;br /&gt;
{&lt;br /&gt;
    if (count($array) &amp;lt; 3) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    asort($array);&lt;br /&gt;
    return array_sum(array_slice($array, 1, -1));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Growth of a Population==&lt;br /&gt;
&lt;br /&gt;
In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new inhabitants per year come to live in the town. How many years does the town need to see its population greater or equal to p = 1200 inhabitants?&lt;br /&gt;
&lt;br /&gt;
At the end of the first year there will be: &lt;br /&gt;
&lt;br /&gt;
1000 + 1000 * 0.02 + 50 =&amp;gt; 1070 inhabitants&lt;br /&gt;
&lt;br /&gt;
At the end of the 2nd year there will be: &lt;br /&gt;
&lt;br /&gt;
1070 + 1070 * 0.02 + 50 =&amp;gt; 1141 inhabitants (number of inhabitants is an integer)&lt;br /&gt;
&lt;br /&gt;
At the end of the 3rd year there will be:&lt;br /&gt;
&lt;br /&gt;
1141 + 1141 * 0.02 + 50 =&amp;gt; 1213&lt;br /&gt;
&lt;br /&gt;
It will need 3 entire years.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function nbYear($p0, $percent, $aug, $p) {&lt;br /&gt;
    return $p0 &amp;gt;= $p ? 0 : 1 + nbYear((int)$p0 * (1+$percent/100) + $aug, $percent, $aug, $p);   &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tom</name></author>	</entry>

	</feed>