<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_混沌的世界</title><subtitle type="text">混沌的世界，混沌的人生(C, C++, PHP, MQL4)</subtitle><id>http://feed.cnblogs.com/blog/u/38198/rss</id><updated>2011-12-20T06:50:03Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/38198/rss"/><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/12/20/quick_radix_sort.html</id><title type="text">基数排序的一个变形应用</title><summary type="text">说起排序，大多数人在实际项目中很少自己去写一个排序，一般来说，qsort一行话就可以了。我也很少在实际项目中用到过基数排序，最近，写了一篇博客文章叫做： 字符串之全文索引 ，这篇文章的下一篇文章 要用到一个倍增算法。这个倍增算法，就可以非常巧妙的运用基数排序。作为那篇文章的一个铺垫，我专门写了一篇基数排序的文章。这篇文章里面的基数排序肯定是一个变形。 大多数网上 或者 书上的基数排序都是从下面的例子开始的： 排序下面的数列： 73 22 93 43 55 14 28 65 39 81 然后对这些数字，用个位数进行排序： 0 ...</summary><published>2011-12-19T16:28:00Z</published><updated>2011-12-19T16:28:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/12/20/quick_radix_sort.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/12/20/quick_radix_sort.html"/><content type="html">&lt;p&gt;说起排序，大多数人在实际项目中很少自己去写一个排序，一般来说，qsort一行话就可以了。我也很少在实际项目中用到过基数排序，最近，写了一篇博客文章叫做： &lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/11/27/2265137.html"&gt;字符串之全文索引&lt;/a&gt; ，这篇文章的下一篇文章 要用到一个倍增算法。这个倍增算法，就可以非常巧妙的运用基数排序。作为那篇文章的一个铺垫，我专门写了一篇基数排序的文章。这篇文章里面的基数排序肯定是一个变形。&lt;/p&gt;  &lt;p&gt;大多数网上 或者 书上的基数排序都是从下面的例子开始的：&lt;/p&gt;  &lt;p&gt;排序下面的数列：&lt;/p&gt;  &lt;p&gt;73&amp;nbsp; 22&amp;nbsp; 93&amp;nbsp; 43&amp;nbsp; 55&amp;nbsp; 14&amp;nbsp; 28&amp;nbsp; 65&amp;nbsp; 39&amp;nbsp; 81&lt;/p&gt;  &lt;p&gt;然后对这些数字，用个位数进行排序：&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="40"&gt;0&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;1&lt;/td&gt;        &lt;td valign="top" width="40"&gt;81&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;2&lt;/td&gt;        &lt;td valign="top" width="40"&gt;22&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;3&lt;/td&gt;        &lt;td valign="top" width="40"&gt;73&lt;/td&gt;        &lt;td valign="top" width="40"&gt;93&lt;/td&gt;        &lt;td valign="top" width="40"&gt;43&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;4&lt;/td&gt;        &lt;td valign="top" width="40"&gt;14&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;5&lt;/td&gt;        &lt;td valign="top" width="40"&gt;55&lt;/td&gt;        &lt;td valign="top" width="40"&gt;65&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;6&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;7&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;8&lt;/td&gt;        &lt;td valign="top" width="40"&gt;28&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;9&lt;/td&gt;        &lt;td valign="top" width="40"&gt;39&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;从这个二维的数组里面顺序取出：&lt;/p&gt;  &lt;p&gt;81 22 73 93 43 14 55 65 28 39&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;再对10位数进行排序：&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="402"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="40"&gt;0&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;1&lt;/td&gt;        &lt;td valign="top" width="40"&gt;14&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;2&lt;/td&gt;        &lt;td valign="top" width="40"&gt;22&lt;/td&gt;        &lt;td valign="top" width="40"&gt;28&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;3&lt;/td&gt;        &lt;td valign="top" width="40"&gt;39&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;4&lt;/td&gt;        &lt;td valign="top" width="40"&gt;43&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;5&lt;/td&gt;        &lt;td valign="top" width="40"&gt;55&lt;/td&gt;        &lt;td valign="top" width="40"&gt;65&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;6&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;7&lt;/td&gt;        &lt;td valign="top" width="40"&gt;73&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;8&lt;/td&gt;        &lt;td valign="top" width="40"&gt;81&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="40"&gt;9&lt;/td&gt;        &lt;td valign="top" width="40"&gt;93&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;        &lt;td valign="top" width="40"&gt;&amp;nbsp;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;从这个二维数组里面顺序取出：&lt;/p&gt;  &lt;p&gt;14 22 28 39 43 55 65 73 81 93&lt;/p&gt;  &lt;p&gt;上面的思路写成代码也非常的容易写：&lt;/p&gt;  &lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;" id="codeSnippetWrapper"&gt;   &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet"&gt;     &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdlib.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; main()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[10]={73,22,93,43,55,14,28,65,39,81};&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; temp[10][10]= {0};&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; order[10]={0};&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i,j,k,n,lsd;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n排序前: "&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i=0; i&amp;lt;10; i++) printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;,data[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;putchar(&lt;span style="color: #006080;"&gt;'\n'&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;n=1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; (n&amp;lt;=10)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i=0;i&amp;lt;10;i++) &lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;lsd=((data[i]/n)%10);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;temp[lsd][order[lsd]]=data[i];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;order[lsd]++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n重新排列: "&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;k = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i=0;i&amp;lt;10;i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;(order[i]!=0)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (j=0;j&amp;lt;order[i];j++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;data[k]=temp[i][j];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;,data[k]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;k++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;order[i]=0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;n *= 10;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;putchar(&lt;span style="color: #006080;"&gt;'\n'&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n排序后: "&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i=0; i&amp;lt;10; i++) printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;,data[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&#xD;
&#xD;
&#xD;
&lt;p&gt;既然这个基数排序理论上性能比较的高，这样的话，我们就写个程序比较一下实际上快速排序和基数排序的速度。&lt;/p&gt;&#xD;
&#xD;
&lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;" id="codeSnippetWrapper"&gt;&#xD;
  &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet"&gt;&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdlib.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;string.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;time.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;algorithm&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#define&lt;/span&gt; MAX_N 5000000&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; sort[10][MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data2[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data3[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; radix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_number);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; intcmp(&lt;span style="color: #0000ff;"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff;"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; *b)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; *((&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; *)a) - *((&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; *)b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; main()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max = -1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;clock_t t;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; MAX_N; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;data[i] = range_rand(1, 0xFFFFFFF);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (max &amp;lt; data[i]) max = data[i];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;memcpy(data2, data, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(data));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;memcpy(data3, data, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(data));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;qsort(data, MAX_N, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;), intcmp);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"qsort cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;radix_sort(data2, MAX_N, max);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"radix cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;std::sort(data3, data3 + MAX_N);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"std::sort cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data2[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data3[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; radix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_number)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; number[10];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; lsd, i, k, j, n;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;n = 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;memset(number, 0, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(number));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; (n &amp;lt;= max_number)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;lsd = (data[i]/n) % 10;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;sort[lsd][number[lsd]] = data[i];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;number[lsd]++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;k = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 10; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;(number[i] != 0)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (j = 0; j &amp;lt; number[i];j++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;data[k] = sort[i][j];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;k++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;number[i] = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;n *= 10;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;double&lt;/span&gt; r = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;    i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;double&lt;/span&gt; mul = 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 3; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;mul *= 0.0001;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;r += (rand() % 10000) * mul;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #008000;"&gt;//0 - 1 中的一个随机数&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;)(r * (max - min)) + min;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&#xD;
&lt;p&gt;我用了500万数据进行测试，在我电脑上的运行结果是：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201112/201112091414295046.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201112/201112091414309671.png" width="244" height="86" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;你会发现C++ stl 里面的sort 是最快的（没有函数调用的损失）。radix sort&amp;nbsp; 和 qsort 性能差不多。所以，在某个数字可能很大的时候，上面的这个算法没有任何性能上的优势，还会浪费非常多的内存。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;基数排序大多数情况下面只适用于下面的情景，一组数，这组数的最大值不是很大，更加准确的说，是要&lt;strong&gt;排序的对象的数目&lt;/strong&gt; 和 &lt;strong&gt;排序对象的最大值&lt;/strong&gt;之间相差不多。比如，这组数 1 4 5 2 2，要排序对象的数目是 5 ，排序对象的最大值也是 5. 这样的情况很适合。我们原来的排序的数，默认是以10为基数，现在，这个改进算法是这样的，我以最大的那个数为基数，这样，所有的数都是&amp;#8220;个位数&amp;#8221;，问题就简单了。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;说了这样多，我觉得还是用程序来表达比较的清晰：&lt;/p&gt;&#xD;
&#xD;
&lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;" id="codeSnippetWrapper"&gt;&#xD;
  &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet"&gt;&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;stdlib.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;string.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;time.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#include&lt;/span&gt; &amp;lt;algorithm&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #cc6633;"&gt;#define&lt;/span&gt; MAX_N 5000000&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; sort[10][MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; quick_radix_sort[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data2[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data3[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data4[MAX_N];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; qradix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; radix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_number);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; intcmp(&lt;span style="color: #0000ff;"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff;"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; *b)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; *((&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; *)a) - *((&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; *)b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; main()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max = -1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;clock_t t;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #008000;"&gt;//初始化随机数种子&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;srand ( time(NULL) );&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; MAX_N; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;data[i] = range_rand(1, MAX_N - 1);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (max &amp;lt; data[i]) max = data[i];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;memcpy(data2, data, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(data));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;memcpy(data3, data, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(data));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;memcpy(data4, data, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(data));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;qsort(data, MAX_N, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;), intcmp);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"qsort cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;radix_sort(data2, MAX_N, max);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"radix cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;std::sort(data3, data3 + MAX_N);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"std::sort cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;qradix_sort(data4, MAX_N);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"quick radix sort cost : %d \n"&lt;/span&gt;, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data2[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data3[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 20; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"%d "&lt;/span&gt;, data4[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;printf(&lt;span style="color: #006080;"&gt;"\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; qradix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i, j, n = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;quick_radix_sort[data[i]]++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (j = 0; j &amp;lt; quick_radix_sort[i]; j++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;data[n++] = i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; radix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_number)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; number[10];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; lsd, i, k, j, n;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;n = 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;memset(number, 0, &lt;span style="color: #0000ff;"&gt;sizeof&lt;/span&gt;(number));&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; (n &amp;lt;= max_number)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;lsd = (data[i]/n) % 10;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;sort[lsd][number[lsd]] = data[i];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;number[lsd]++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;k = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 10; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;(number[i] != 0)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (j = 0; j &amp;lt; number[i];j++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;data[k] = sort[i][j];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;k++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;number[i] = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;n *= 10;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;double&lt;/span&gt; r = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;    i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;double&lt;/span&gt; mul = 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 3; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;mul *= 0.0001;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;r += (rand() % 10000) * mul;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #008000;"&gt;//0 - 1 中的一个随机数&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;)(r * (max - min)) + min;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;这个代码其实就是在上面的测试代码的基础上加上了一个qradix_sort 函数，这个函数非常的简单：&lt;/p&gt;&#xD;
&#xD;
&lt;div id="codeSnippetWrapper"&gt;&#xD;
  &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet"&gt;&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; qradix_sort(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; data[], &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; max_index)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i, j, n = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;quick_radix_sort[data[i]]++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; max_index; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;&lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; (j = 0; j &amp;lt; quick_radix_sort[i]; j++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;data[n++] = i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&#xD;
&lt;p&gt;循环体里面就两句话，和我们前面的那个基数排序不是很一样，这里，已经不用一个二维数组保存排序的数字了，只是标记一下这个数字有几个，因为，下标其实就是被排序的数字。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;重新排序这个循环也很简单，仔细冥想一下怎么回事，不懂就在草稿纸上画画草图吧。这里主要的思想还是，下标就是排序的数字。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;最后的排序测试结果：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201112/201112200027562278.png"&gt;&lt;img style="margin: 0px; border: 0px currentColor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline;background-image: none;" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201112/201112200027583871.png" width="287" height="70" /&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;我们发现，现在普通的radix性能也提高了，因为，现在数字变小了，循环的次数也变少了。快速基数排序的性能提高还是非常的明显。普通基数排序的两倍，std::sort 的3倍，qsort的 5倍，最重要的是代码非常的简单，基本上是你见过的最简单的一个排序了。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;对一个真正的程序员来说，很少这样要死抠一个程序的性能，一般情况下，也是得不偿失。只有，在某个东西真正成了一个性能瓶颈的时候，我们才需要去关心一下：是不是可以这样改进一下。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;这个排序算法，将来会应用到 字符串处理的倍增算法里面，这个倍增算法，要反复的进行排序。如果，排序能快一点，这个程序就能快很多。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2281962.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/12/20/quick_radix_sort.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/12/09/2282915.html</id><title type="text">如何学习Yii</title><summary type="text">我是在Yii的官方wiki上看到这篇文章的。读的第一遍觉得很不错，还有一种想翻译出来的冲动。虽然，本人英文很烂，但是毕竟写了这样多年的代码，估计大概的意思是能有的吧。英文原文：http://www.yiiframework.com/wiki/268/how-to-learn-yii/ 下面是针对Yii的初学者的一个一步一步如何学习Yii的列表。这个列表列出了一些文档，教程，希望你能够阅读，这些文档，教程有助于我们理解Yii这个框架。 1. 学习PHP。当然，你需要先学习PHP编程。w3cschool 上有一个很好的教程，教程分成 语言基础 高级功能 数据库操作三个部分。有一个小技巧，...</summary><published>2011-12-09T15:13:00Z</published><updated>2011-12-09T15:13:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/12/09/2282915.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/12/09/2282915.html"/><content type="html">&lt;p&gt;&lt;em&gt;&lt;font size="3"&gt;我是在Yii的官方wiki上看到这篇文章的。读的第一遍觉得很不错，还有一种想翻译出来的冲动。虽然，本人英文很烂，但是毕竟写了这样多年的代码，估计大概的意思是能有的吧。英文原文：&lt;/font&gt;&lt;/em&gt;&lt;a title="http://www.yiiframework.com/wiki/268/how-to-learn-yii/" href="http://www.yiiframework.com/wiki/268/how-to-learn-yii/"&gt;&lt;em&gt;&lt;font size="3"&gt;http://www.yiiframework.com/wiki/268/how-to-learn-yii/&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;下面是针对Yii的初学者的一个一步一步如何学习Yii的列表。这个列表列出了一些文档，教程，希望你能够阅读，这些文档，教程有助于我们理解Yii这个框架。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. 学习PHP。&lt;/strong&gt;当然，你需要先学习PHP编程。w3cschool 上有一个很好的&lt;a href="http://www.w3schools.com/php/default.asp"&gt;教程&lt;/a&gt;，教程分成 语言基础 高级功能 数据库操作三个部分。有一个小技巧，永远要使用php.net 来查找一个函数的用法&lt;em&gt;。（个人觉得初学者一定要经常的翻翻PHP的手册，每个函数都去仔细的读一下，包括下面的评论，一定会让你受益匪浅）&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. 学习面向对象编程。&lt;/strong&gt;你至少要懂一些基本的面向对象编程的东西。这里有一个&lt;a href="http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/"&gt;基本教程&lt;/a&gt; （&lt;em&gt;这个教程很不错，当然不要忘记php.net上的教程&lt;/em&gt;），如果你很懒，这里还有个&lt;a href="http://www.killerphp.com/tutorials/object-oriented-php/"&gt;视屏教程&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;3. MVC 。&lt;/strong&gt;&amp;#160; 你要非常深刻的理解MVC 这个设计模式。如果你不知道MVC是何物，你一定会觉得Yii框架是什么玩意啊，怎么这样混乱，还不如老子自己写的框架呢？当然，如果你突然顿悟了，啥是MVC，你会发现一切是那么的自然。要学习MVC，推下面几篇文章：&lt;a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller"&gt;Model&amp;#8211;view&amp;#8211;controller&lt;/a&gt; ，还有YY官方的两篇很出名的 ： &lt;a href="http://www.yiiframework.com/doc/guide/1.1/zh_cn/basics.best-practices"&gt;MVC 最佳实践&lt;/a&gt;&amp;#160; &lt;a href="http://www.yiiframework.com/doc/guide/1.1/zh_cn/basics.mvc"&gt;MVC基础&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;4. 简单入门。&lt;/strong&gt;这里有一个非常好的&lt;a href="http://www.yiiframework.com/screencasts/"&gt;视频教程&lt;/a&gt;（&lt;em&gt;看这个视频国内看不了，怎么做，你懂的&lt;/em&gt;），看过这个教程之后就可以看 &lt;a href="http://www.larryullman.com/series/learning-the-yii-framework"&gt;Larry 的博客上提供的教程&lt;/a&gt;。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;5. 阅读手册。&lt;/strong&gt;Yii 的&lt;a href="http://www.yiiframework.com/doc/guide/1.1/zh_cn/index"&gt;手册&lt;/a&gt;非常的有用。非常建议你从头到尾看一遍手册，并且好好的看手册里面的评论。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;6. 上面的准备工作已经完成了，你应该要开始动手了。&lt;/strong&gt;你可以先读读： &lt;a href="http://www.packtpub.com/agile-web-application-development-yii11-and-php5/book#in_detail"&gt;Yii Agile Web Application Development&lt;/a&gt; 这本书，或者跟着这个&lt;a href="http://www.yiiframework.com/doc/blog/"&gt;博客教程&lt;/a&gt;做。你阅读上面这本书的时候，注意阅读下面的 &lt;a href="http://www.yiiframework.com/forum/index.php?/forum/38-agile-web-application-development-with-yii11-and-php5/"&gt;勘误表&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;7. 其他。&lt;/strong&gt;&lt;a href="http://yiicookbook.org/"&gt;Yii Application Development Cookbook&lt;/a&gt; 这本书里面有很多有用的小技巧。同时，你可以阅读 &lt;a href="http://www.yiiframework.com/wiki/"&gt;Yii wiki&lt;/a&gt; 和 &lt;a href="http://www.yiiframework.com/doc/api/"&gt;Yii 类库手册&lt;/a&gt;（API 文档,这些文档是代码中的注释自动生成的）。如果你有问题，就去&lt;a href="http://www.yiiframework.com/forum/"&gt;论坛&lt;/a&gt;提问吧。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;8. 更多工具。&lt;/strong&gt;这里有很多 Yii 的&lt;a href="http://www.yiiframework.com/extensions/"&gt;扩展&lt;/a&gt;。这些是Yii社区贡献的一些额外的工具箱，可以在你的应用程序里面重用。&lt;/p&gt;  &lt;p&gt;第一步 和 第二步 可能要花费几天，几个星期，或者几年   &lt;br /&gt;第三步 到 第五步 只要花费几个小时就够了    &lt;br /&gt;第六步 可能要花个几天，如果你只是利用业余时间进行学习的话。&lt;/p&gt;  &lt;p&gt;这些都完成之后，当然，你就可以开始编写自己的Yii 应用了。&lt;/p&gt;  &lt;p&gt;&lt;em&gt;我的一些建议：&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;在实际做了一些项目之后，我想比较重要的是，阅读Yii的源代码。     &lt;br /&gt;作为一个面向对象的框架，一定要绘制出UML图，这样可以加深对这个框架的理解。      &lt;br /&gt;Yii的思想不仅仅是 MVC，其中有一个非常重要两个概念是      &lt;br /&gt;&amp;quot;组件&amp;quot; 和 &amp;quot;事件&amp;quot;， 他们贯穿Yii的整个设计。&lt;/em&gt;&lt;/p&gt; &lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2282915.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/12/09/2282915.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/11/30/2268674.html</id><title type="text">如何在apache启动的时候不输入ssl的密码</title><summary type="text">今天突然发现网站挂掉了。原因就是机房意外的重启了我的机器，因为apache 要输入ssl密码才能启动，所以就启动不起来。 用下面的方法就可以避免这个问题： ee /usr/local/etc/apache22/httpd.conf 找到： &amp;lt;IfModule ssl_module&amp;gt; 加入这样一行： SSLPassPhraseDialog exec:/usr/local/e...</summary><published>2011-11-30T02:12:00Z</published><updated>2011-11-30T02:12:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/11/30/2268674.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/11/30/2268674.html"/><content type="html">&lt;p&gt;今天突然发现网站挂掉了。原因就是机房意外的重启了我的机器，因为apache 要输入ssl密码才能启动，所以就启动不起来。&lt;/p&gt;  &lt;p&gt;用下面的方法就可以避免这个问题：&lt;/p&gt;  &lt;p&gt;ee /usr/local/etc/apache22/httpd.conf&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;找到：&lt;/p&gt;  &lt;p&gt;&amp;lt;IfModule ssl_module&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;加入这样一行：&lt;/p&gt;  &lt;p&gt;SSLPassPhraseDialog&amp;#160; exec:/usr/local/etc/apache22/ssl_pass.sh&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;ee /usr/local/etc/apache22/ssl_pass.sh&lt;/p&gt;  &lt;p&gt;加入一个echo语句&lt;/p&gt;  &lt;p&gt;#!/bin/sh&lt;/p&gt;  &lt;p&gt;echo “password”&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;然后让它有执行权限：&lt;/p&gt;  &lt;p&gt;chmod +x /usr/local/etc/apache22/ssl_pass.sh&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;再重启一下服务器测试一下看看有没有问题。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2268674.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/11/30/2268674.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/11/27/2265137.html</id><title type="text">字符串之全文索引</title><summary type="text">字符串，我现在正在写的就是一个字符串。我们的源代码就是一个字符串，计算机科学里面，一大部分问题都是字符串处理的问题。比如，编译器，就是一个字符串处理程序。还有，搜索引擎，也在处理一个字符串问题。数据库，最难处理的还是字符串部分。索引，一般是一种预处理的中间程序。在我们写代码的时候，往往需要对一个对象进行预处理。这个预处理时间可能比较长，但是，处理完了以后，就能很快的多次的在上面进行查询。比如，你要在一组数里面进行查找，可能先要进行排序，这样速度就会快一些, 排序可以看做是建立索引的一个过程。 字符串的全文索引，怎么样才能非常的省空间，查找速度也还可以，我这里介绍一种数据结构，叫做后缀数组。 .</summary><published>2011-11-27T08:55:00Z</published><updated>2011-11-27T08:55:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/11/27/2265137.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/11/27/2265137.html"/><content type="html">&lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;&#xD;
&lt;p&gt;字符串，我现在正在写的就是一个字符串。我们的源代码就是一个字符串，计算机科学里面，一大部分问题都是字符串处理的问题。比如，编译器，就是一个字符串处理程序。还有，搜索引擎，也在处理一个字符串问题。数据库，最难处理的还是字符串部分。索引，一般是一种预处理的中间程序。在我们写代码的时候，往往需要对一个对象进行预处理。这个预处理时间可能比较长，但是，处理完了以后，就能很快的多次的在上面进行查询。比如，你要在一组数里面进行查找，可能先要进行排序，这样速度就会快一些, 排序可以看做是建立索引的一个过程。&lt;/p&gt;&#xD;
&lt;p&gt;字符串的全文索引，怎么样才能非常的省空间，查找速度也还可以，我这里介绍一种数据结构，叫做后缀数组。&lt;/p&gt;&#xD;
&lt;p&gt;概念不多说，我就在例子中说明什么东西是后缀数组吧。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;step 1. 所有的后缀：&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;string a = &amp;#8216;aabbaa&amp;#8217;;&lt;/p&gt;&#xD;
&lt;p&gt;找到所有的后缀：&lt;/p&gt;&#xD;
&lt;p&gt;0 aabbaa&lt;/p&gt;&#xD;
&lt;p&gt;1 abbaa&lt;/p&gt;&#xD;
&lt;p&gt;2 bbaa&lt;/p&gt;&#xD;
&lt;p&gt;3 baa&lt;/p&gt;&#xD;
&lt;p&gt;4 aa&lt;/p&gt;&#xD;
&lt;p&gt;5 a&lt;/p&gt;&lt;/blockquote&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;step &lt;font color="#444444"&gt;2. 对所有的后缀进行排序：&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;0 (5)a&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;1 (4)aa&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;2 (0)aabbaa&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;3 (1)abbaa&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;4 (3)baa&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;5 (2)bbaa&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;小括号里面的就是原来的索引值。&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;排序后的这个数组就叫做后缀数组。&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;下面这个程序，我想让大家更加感性的认识一下后缀数组是什么东西：&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&#xD;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;stdlib.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//5M&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; MAX_LEN 1024 * 1024 * 5&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; str[MAX_LEN + 1], *suffix_array[MAX_LEN + 32];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; readstr();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; cmpnum, charcmpnum;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pstrcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; main()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n, i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;n = readstr();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"string = %s\n"&lt;/span&gt;, str);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"All Suffix:\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; n; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;suffix_array[i] = str + i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"%d %s\n"&lt;/span&gt;, i, suffix_array[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;qsort(suffix_array, n , &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *), pstrcmp);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"Suffix Array:\n"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; n; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"%d (%d) %s\n"&lt;/span&gt;, i, suffix_array[i] - str, suffix_array[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; readstr()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ch;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt; ((ch = getchar()) != EOF)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;str[n++] = (&lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)ch;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (n &amp;gt;= MAX_LEN) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (str[n-1] == &lt;span style="color: #006080"&gt;'\r'&lt;/span&gt; || str[n-1] == &lt;span style="color: #006080"&gt;'\n'&lt;/span&gt;)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;n--;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;str[n] = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; n;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pstrcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *p = *((&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)a), *q = *((&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; c1 , c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;cmpnum++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;do&lt;/span&gt; {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*p++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c2 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*q++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;charcmpnum++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c1 == &lt;span style="color: #006080"&gt;'\0'&lt;/span&gt;) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; c1 - c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (c1 == c2);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; c1 - c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;运行这个程序的方法是输入一个字符串，然后输入EOF 字符串&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;比如输入 aabbaa[回车][ctrl+z][回车] 的结果是&lt;/font&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201111/201111271654517866.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201111/201111271654513340.png" width="218" height="277" /&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;后缀数组就是将所有的字符串后缀进行排序，注意，代码空间复杂度，每一个后缀只是保存了一个指针，并没有复制整个字符串。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;啰嗦了半天，到底这个东西怎么做全文索引呢？你看非常简单的代码，核心的代码就几行，你肯定觉得这个东西没有用。编程珠玑的 第15章 字符串 有关于这个话题的讨论，大家可以去看看。介绍算法不是我写这篇博客的目的，我想写一些超越算法了一些东西，这篇只是开一个头。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;font color="#444444"&gt;&lt;strong&gt;这个后缀数组的所有前缀就是所有的substring(子串)。用过数据库的人可能知道数据库里面的 like 查询 查前缀(like prefix% )要比查后缀(like %suffix )或者任意的查询(like %query%)快很多.原因就是数据库里面是按照字母顺序存储的，这样前缀查询可以二分查找，速度就快了。后缀数组的原理也是这样。一个查询问题转换为一个前缀查询的问题，但是转换的方法却是通过后缀, 很有老庄哲学的韵味。&lt;/strong&gt;&lt;/font&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;下面的程序是读入一个很长的字符串，我测试的是一本23万个英语单词的字典。先随机从这本英文字典里面抽取了5000个单词，然后，把正本字典看做一个字符串，在这本字典里面进行查询，分别用系统自带的 strstr (kMP算法) 和 我们的全文索引(后缀数组进行查询) 看看性能会差多少：&lt;/p&gt;&#xD;
&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&#xD;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; _CRT_SECURE_NO_WARNINGS&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;stdlib.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;string.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;time.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;windows.h&amp;gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//5M&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; MAX_LEN 1024 * 1024 * 5&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//一个单词的最大长度&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; MAX_WORD 255&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; MAX_DICT 500000&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//路径的最大长度&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#ifndef&lt;/span&gt; MAX_PATH&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; MAX_PATH 256&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#endif&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;#define&lt;/span&gt; TEST_NUM 5000&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//函数列表&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; read_str();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; read_dict(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; * filepath);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pstrcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; * dirname(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *path, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; count);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; max);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; prefixcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test_full_index();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test_strstr();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//全局变量&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; str[MAX_LEN + 1]; &lt;span style="color: #008000"&gt;//原始字符串&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *suffix_array[MAX_LEN + 32]; &lt;span style="color: #008000"&gt;//后缀数组&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *dict[MAX_DICT]; &lt;span style="color: #008000"&gt;//测试字典&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;  cmpnum, charcmpnum; &lt;span style="color: #008000"&gt;//以后可能用来测试性能的计数&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *query[TEST_NUM];  &lt;span style="color: #008000"&gt;//查询表达式&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; dictn, strn;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; main(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; argc, &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *argv[])&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (argc &amp;lt; 2) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"usage: %s dict_path"&lt;/span&gt;, argv[0]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;exit(0);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//读取字典，构建测试查询&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"dict path is: %s\n"&lt;/span&gt;, argv[1]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;dictn = read_dict(argv[1]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; TEST_NUM; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;query[i] = dict[range_rand(0, dictn)];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//最好free掉dict的内存，对于这样简单的程序，没有多少必要，程序结束以后，自动释放。&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//创建后缀数组, 从stdin读取&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;strn = read_str();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; strn; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;suffix_array[i] = str + i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;qsort(suffix_array, strn, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *), pstrcmp);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//测试通过后缀数组建立的索引进行全文查找&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;test_full_index();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//测试通过普通子串查询, 这些算法一般用KMP算法。&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;test_strstr();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test_full_index()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i , t, nofind = 0, find = 0; &lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; TEST_NUM; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **index;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;index = (&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)bsearch(query[i], suffix_array, strn, &lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *), prefixcmp);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (index == NULL) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;nofind++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;find++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"full index, find : %d , not find: %d, cost: %d ms\n"&lt;/span&gt;, find, nofind, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; test_strstr()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i , t, nofind = 0, find = 0; &lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;t = clock();&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; TEST_NUM; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *index;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;index = strstr(str, query[i]);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (index == NULL) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;nofind++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;find++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;printf(&lt;span style="color: #006080"&gt;"strstr, find : %d , not find: %d, cost: %d ms\n"&lt;/span&gt;, find, nofind, clock() - t);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; read_str()&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ch;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt; ((ch = getchar()) != EOF)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;str[n++] = (&lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)ch;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (n &amp;gt;= MAX_LEN) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (str[n-1] == &lt;span style="color: #006080"&gt;'\r'&lt;/span&gt; || str[n-1] == &lt;span style="color: #006080"&gt;'\n'&lt;/span&gt;)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;n--;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;str[n] = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; n;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; read_dict(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; * filepath)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; buffer[MAX_WORD];&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;FILE *fp = fopen(filepath, &lt;span style="color: #006080"&gt;"r"&lt;/span&gt;);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (fp == NULL) &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (fscanf(fp, &lt;span style="color: #006080"&gt;"%s"&lt;/span&gt;, buffer) != EOF)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; word_len = strlen(buffer) + 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (n &amp;gt;= MAX_DICT) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;dict[n++] = (&lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *)malloc(word_len);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;memcpy(dict[n-1], buffer, word_len);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; n;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pstrcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *p = *((&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)a), *q = *((&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)b);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; c1 , c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;cmpnum++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;do&lt;/span&gt; {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*p++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c2 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*q++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;charcmpnum++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c1 == &lt;span style="color: #006080"&gt;'\0'&lt;/span&gt;) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; c1 - c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (c1 == c2);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; c1 - c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; prefixcmp(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *a, &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; *b)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *p = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *)a, *q = *(&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; **)b;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; c1 , c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;do&lt;/span&gt; {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*p++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c2 = (&lt;span style="color: #0000ff"&gt;unsigned&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;)*q++;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c1 == &lt;span style="color: #006080"&gt;'\0'&lt;/span&gt;) {&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0; &lt;span style="color: #008000"&gt;//match&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (c1 == c2);&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; c1 - c2;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; range_rand(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; min, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; max)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;double&lt;/span&gt; r = 0;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;    i;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;double&lt;/span&gt; mul = 1;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; 3; i++)&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;mul *= 0.0001;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;r += (rand() % 10000) * mul;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;//0 - 1 中的一个随机数&lt;/span&gt;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)(r * (max - min)) + min;&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&#xD;
&#xD;
      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&#xD;
&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;后面的一些小函数大概比较多，其实主要看main函数就可以了。&lt;/p&gt;&#xD;
&lt;p&gt;命令行运行：suffix_array dict.txt &amp;lt; dict.txt , 用了一个文件重定向到stdin，附件中有这本测试字典。&lt;/p&gt;&#xD;
&lt;p&gt;测试结果是：&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201111/201111271712349679.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201111/201111271712369788.png" width="539" height="108" /&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;可以发现，性能差的挺多了，有1000倍。如果字符串更加的长，差别会更加的大。&lt;/p&gt;&#xD;
&lt;p&gt;这篇博客还只是个引子，实际上，理论上来说，我们采用qsort的方法来排序后缀数组性能比较低。但是，实际用起来这几乎是最好的方法。这是一个典型的一行顶一万行的例子。后缀数组的应用也不仅仅是做全文索引这样一种功能，欲知详情，请关注下一篇博客：&lt;strong&gt;字符串之后缀数组倍增算法。&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2265137.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/11/27/2265137.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/10/11/2206979.html</id><title type="text">2011 october calendar wallpapers</title><summary type="text">Wallpaperfox contain many anime wallpapers, such as Fairy Tailwallpapers, bleach wallpapers, naruto wallpapers, one piece wallpapers, and so on. October is a busy season, the anime wallpaper site posts a series of 2011 calendar wallpapers, divided into two topics, one topic is about Halloween, anoth</summary><published>2011-10-11T03:09:00Z</published><updated>2011-10-11T03:09:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/10/11/2206979.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/10/11/2206979.html"/><content type="html">&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Wallpaperfox contain many &lt;a href="http://www.wallpaperfox.com/"&gt;anime wallpapers&lt;/a&gt;, such as Fairy Tail&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;wallpapers, bleach wallpapers, naruto wallpapers, one piece wallpapers, and so on. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;October is a busy season, the anime wallpaper site posts a series of &lt;a href="http://www.wallpaperfox.com/topic/2011%20calendar"&gt;2011 calendar wallpapers,&lt;/a&gt; divided into two topics, one topic is about Halloween, another topic is about international music.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;The two part of the calendar special wallpaper are our design elaborated, &lt;a href="http://www.wallpaperfox.com/tag/Oct%202011%20Calendar"&gt;Halloween Wallpapers&lt;/a&gt; show the Halloween element fully, and the&lt;strong&gt; &lt;/strong&gt;international music wallpapers will fully demonstrate the beauty of music. You can download the&lt;strong&gt; &lt;a href="http://www.wallpaperfox.com/tag/Oct%202011%20Calendar"&gt;&lt;strong&gt;2011 october calendar wallpapers&lt;/strong&gt; &lt;/a&gt;&lt;/strong&gt;for your desktop, or recommend to your friends. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;&lt;a href="http://www.wallpaperfox.com/wallpaper/19674-Strawberry-girl-International-Music"&gt;&lt;img border="0" alt="Ichigo Mashimaro wallpaper Strawberry girl International Music" src=http://images.cnblogs.com/cnblogs_com/niniwzw/4e7ad7ff472c3.jpg width="646" height="403" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2206979.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/10/11/2206979.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/04/28/2032223.html</id><title type="text">深入PHP内核（1） 引用</title><summary type="text">最近，和一个网友交流的时候，给我提了一个非常奇怪的问题。那就是，在一个运算中，加了一个引用之后，发现性能慢了一万倍。在我的脑海里面，引用是一个非常容易出错的问题，特别是PHP里面的引用，有非常多的陷阱。因为，以前专门研究过这一块PHP的源代码，所以，我可以比较清晰的解析引用到底是怎么一回事，希望，读了我这篇博客的PHP开发者，能彻底理解这个问题。如果，有任何疑问，或者有一些你想了解的问题，可以给我留言。  先来看一段代码: class RefferTest{ private $data; private $testKey; function __construct() { $key = &amp;qu</summary><published>2011-04-28T13:53:00Z</published><updated>2011-04-28T13:53:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/04/28/2032223.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/04/28/2032223.html"/><content type="html">&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; 最近，和一个网友交流的时候，给我提了一个非常奇怪的问题。那就是，在一个运算中，加了一个引用之后，发现性能慢了一万倍。在我的脑海里面，引用是一个非常容易出错的问题，特别是PHP里面的引用，有非常多的陷阱。因为，以前专门研究过这一块PHP的源代码，所以，我可以比较清晰的解析引用到底是怎么一回事，希望，读了我这篇博客的PHP开发者，能彻底理解这个问题。如果，有任何疑问，或者有一些你想了解的问题，可以给我留言。&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;先来看一段代码:&lt;/p&gt;  &lt;pre &gt;&lt;span &gt;class&lt;/span&gt; RefferTest&#xD;
{&#xD;
    &lt;span &gt;private&lt;/span&gt; $data;&#xD;
    &lt;span &gt;private&lt;/span&gt; $testKey;&#xD;
    function __construct()&#xD;
    {&#xD;
        $key = &lt;span &gt;&amp;quot;hello&amp;quot;&lt;/span&gt;;&#xD;
        $&lt;span &gt;this&lt;/span&gt;-&amp;gt;data[$key] = range(0, 10000);&#xD;
        $&lt;span &gt;this&lt;/span&gt;-&amp;gt;testKey = $key;&#xD;
    }&#xD;
&#xD;
    function reffer($key)&#xD;
    {&#xD;
        $reffer = &amp;amp;$&lt;span &gt;this&lt;/span&gt;-&amp;gt;data[$key];&#xD;
        &lt;span &gt;return&lt;/span&gt; count($reffer);&#xD;
    }&#xD;
&#xD;
    function noreffer($key)&#xD;
    {&#xD;
       &lt;span &gt;return&lt;/span&gt; count($&lt;span &gt;this&lt;/span&gt;-&amp;gt;data[$key]);&#xD;
    }&#xD;
&#xD;
    function test()&#xD;
    {&#xD;
        $t1 = microtime(&lt;span &gt;true&lt;/span&gt;);&#xD;
        &lt;span &gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; 5000; $i++)&#xD;
        {&#xD;
            $&lt;span &gt;this&lt;/span&gt;-&amp;gt;reffer($&lt;span &gt;this&lt;/span&gt;-&amp;gt;testKey);&#xD;
        }&#xD;
        $t2 = microtime(&lt;span &gt;true&lt;/span&gt;) - $t1;&#xD;
        var_dump(&lt;span &gt;&amp;quot;reffer: &amp;quot;&lt;/span&gt; . round($t2, 4));&#xD;
        &#xD;
        $t1 = microtime(&lt;span &gt;true&lt;/span&gt;);&#xD;
        &lt;span &gt;for&lt;/span&gt; ($i = 0; $i &amp;lt; 5000; $i++)&#xD;
        {&#xD;
            $&lt;span &gt;this&lt;/span&gt;-&amp;gt;noreffer($&lt;span &gt;this&lt;/span&gt;-&amp;gt;testKey);&#xD;
        }&#xD;
        $t2 = microtime(&lt;span &gt;true&lt;/span&gt;) - $t1;&#xD;
        var_dump(&lt;span &gt;&amp;quot;noreffer: &amp;quot;&lt;/span&gt; . round($t2, 4));&#xD;
    }&#xD;
}&#xD;
$test = &lt;span &gt;new&lt;/span&gt; RefferTest();&#xD;
$test-&amp;gt;test();&lt;/pre&gt;&#xD;
&#xD;
&lt;pre &gt;&amp;#160;&lt;/pre&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;如果你完这个代码，能说出，为了reffer 和 noreffer会差一万倍的性能，那下面的也就没有必要往下看了。这篇博客针对的是，PHP的新手。你可以运行一下这个代码试试看，的确差了一万倍。当然，那个网友遇到的问题的代码要比上面的复杂，上面的代码是我为了说明问题，特意简化的。或许你已经从代码里面看出问题了，但是，至于为什么会这样。我想，还是有必要分析一下。这样，以后，在使用PHP的时候，才不会犯相同的错误。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&amp;#160;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;PHP为了减少复制，采用了一种copy on writer的机制。我想，这是一种非常常见的机制，你也一定听说过。比如，gcc 的 stl string 的实现，就是采用这样的机制，字符串赋值，不是真正的复制，而且，在修改的时候才会进行复制。我们先来举个最简单的例子：&lt;/p&gt;&#xD;
&#xD;
&lt;div &gt;&#xD;
  &lt;pre&gt;&lt;span &gt;   1:  &lt;/span&gt;$a = str_repeat(&lt;span &gt;&amp;quot;0&amp;quot;&lt;/span&gt;, 10000);&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   2:  &lt;/span&gt;$b = $a;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   3:  &lt;/span&gt;$a[0] = &lt;span &gt;&amp;quot;1&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;$a 是一个非常大的字符串，如果 $b = $a 的时候，进行复制，那要耗费很多内存 和 cpu，这样非常的不划算，万一，下面的代码并不修改$a 和 $b 那复制根本没有必要。当然，$a 在后面又被修改了，这个时候，必须进行复制了，否则就不符合逻辑了。但是，现在问题来了，怎么知道，$a 在修改的时候，要进行复制呢，必须要有这样一个标记。方法就是采用引用计数。引用计数还被用来进行内存的管理。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;基本的流程是这样的：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;1: 创建一个变量，可以保存 10000 个 0 的这样一个字符串。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;2: 创建一个变量符号 a ，这个变量符号引用 这个变量。注意，变量符号 和 变量不是一回事情，这两者是分离的。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;如果从C语言的角度来说，PHP大概完成这样一件事情：&lt;/p&gt;&#xD;
&#xD;
&lt;div &gt;&#xD;
  &lt;pre&gt;&lt;span &gt;   1:  &lt;/span&gt;&lt;span &gt;char&lt;/span&gt; *varname = &lt;span &gt;&amp;quot;a&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   2:  &lt;/span&gt;size_t varname_len = strlen(varname);&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   3:  &lt;/span&gt;zend_hash_add(EG(active_symbol_table), varname, varname_len + 1, &amp;amp;var, &lt;span &gt;sizeof&lt;/span&gt;(zval*), NULL);&lt;/pre&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;active_symbol_table 是PHP的一个符号表，所有能访问到的变量都在这个里面，他是一个哈希表。var 这个变量，保存了 10000 个 0 这个字符串。而且是zval的结构，zval的结构如下：&lt;/p&gt;&#xD;
&#xD;
&lt;pre &gt;typedef &lt;span &gt;struct&lt;/span&gt; _zval_struct {&#xD;
    zvalue_value &lt;span &gt;value&lt;/span&gt;;&#xD;
    zend_uint refcount;&#xD;
    zend_uchar type;&#xD;
    zend_uchar is_ref;&#xD;
} zval;&lt;/pre&gt;&#xD;
&#xD;
&lt;pre &gt;typedef union _zvalue_value {&#xD;
    &lt;span &gt;long&lt;/span&gt; lval;&#xD;
    &lt;span &gt;double&lt;/span&gt; dval;&#xD;
    &lt;span &gt;struct&lt;/span&gt; {&#xD;
        &lt;span &gt;char&lt;/span&gt; *val;&#xD;
        &lt;span &gt;int&lt;/span&gt; len;&#xD;
    } str;&#xD;
    HashTable *ht;&#xD;
    zend_object_value obj;&#xD;
} zvalue_value;&lt;/pre&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;&amp;#160;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;zvalue_value 是一个联合，可以保存 long， double， 字符串，哈希表（PHP Array），还有就是 对象。也就是所有的PHP的类型。 zval 其实 就是 对 zvalue_value ，加入了类型type 和 引用is_ref，引用计数refcount三个功能。这就是PHP中的普通变量。要是用PHP做比较大型的东西，就会发现，内存占用非常厉害。就是因为，他一个变量 不是 传统C语言的那个变量了，它加了很多东西。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;好了，第一句完成了，下面是第二句。第二句很简单，会产生一个新的变量符号b，把他加入 active_symbol_table ，但是不会增加新的一个变量，而只是，refcount++。赋值就完成了。如图：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152246158.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001[7]" border="0" alt="clip_image001[7]" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152254174.gif" width="262" height="155" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&amp;#160;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;首先我们要注意的是，a ，b 只是一个符号，他是active_symbol_table 表里面的一个key，都有一个指针指向一个zval，所以，a 和b 在 C语言层面上是完全一致的。我们就得出PHP变量第一定律： &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;strong&gt;PHP变量第一定律：如果两个变量指向同一个zval，那么这两个变量是无差别的。也就是说，任何对a 的操作 相对b 都是对称的。&lt;/strong&gt;这里的对称，是这样理解的。就是镜子中的你，而不是等同。比如，对 a 进行 赋值，a 就会产生 copy。同样的，如果对b进行赋值，也会进行相同的操作，那就是b产生一个copy。也就是说，a 和b的行为是一样的。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&amp;#160;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;第三句，当writer发生的时候，PHP会判断一下refcount 是否大于2，如果大于2，那么就复制一下zval，然后，把原来那个zval refcount--。这就是copy on writer 的全部了，你一定觉得，这一切你都是非常的熟悉，你都懂。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&amp;#160;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;但是，PHP不仅仅是copy on writer 这样简单，它还有一个引用的问题。引入引用的概念，这样，问题就变的有些复杂了。因为，引用这个标记，意思就是说，writer 的时候，你也不需要复制。这样，会修改原来的那个变量。从我们在学校里面以前经常学习的哲学上来说，这是一对矛盾。他们是对立的，又是统一的，各有各的用处。所谓，存在的就是合理的。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;好，下面我们来看看这对矛盾，我们只考虑两种组合的情况。多种组合都是类似的。两种组合的话，就是赋值在前，引用在后。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;或者&amp;#160; 引用在前，赋值在后。我们会分别讨论，先来看：就是赋值在前，引用在后的情况。&lt;/p&gt;&#xD;
&#xD;
&lt;div &gt;&#xD;
  &lt;pre&gt;&lt;span &gt;   1:  &lt;/span&gt;    $a = 1;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   2:  &lt;/span&gt;    $b = $a;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   3:  &lt;/span&gt;    $c = &amp;amp;$a;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&amp;#160;&lt;/pre&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;$b = $a, 是copy on writer 行为的 赋值。而 $c 和 $a 是引用赋值。我们假设在上面这样的情况下，我们可以用一个zval表示，也就是不需要复制，那么情况是这样的：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152256649.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001[9]" border="0" alt="clip_image001[9]" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152251948.gif" width="262" height="155" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;根据我们&lt;strong&gt;的PHP变量第一定律&lt;/strong&gt;，那，就是说，a，b，c的操作是对称的，但是非常明显，对 b 操作要产生复制行为，而对a操作不会产生复制，操作行为不相同，和第一定律矛盾。也就是说，要使得上面的操作没有矛盾，必须，进行分离。分离的原则就是，谁制造矛盾，谁复制。显然是 第三句话，$c = &amp;amp;$a; 在制造矛盾。所以，内部变量的复制过程如下图： &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152288794.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152314319.png" width="595" height="430" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;上面情况是赋值在前，引用在后的情况。还有一种情况是，引用在前赋值在后：&lt;/p&gt;&#xD;
&#xD;
&lt;div &gt;&#xD;
  &lt;pre&gt;&lt;span &gt;   1:  &lt;/span&gt;    $a = 1;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   2:  &lt;/span&gt;    $b = &amp;amp;$a;&lt;/pre&gt;&#xD;
&#xD;
  &lt;pre&gt;&lt;span &gt;   3:  &lt;/span&gt;    $c = $a;&lt;/pre&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;style type="text/css"&gt;&#xD;
&#xD;
.csharpcode, .csharpcode pre&#xD;
{&#xD;
	font-size: small;&#xD;
	color: black;&#xD;
	font-family: consolas, "Courier New", courier, monospace;&#xD;
	background-color: #ffffff;&#xD;
	/*white-space: pre;*/&#xD;
}&#xD;
.csharpcode pre { margin: 0em; }&#xD;
.csharpcode .rem { color: #008000; }&#xD;
.csharpcode .kwrd { color: #0000ff; }&#xD;
.csharpcode .str { color: #006080; }&#xD;
.csharpcode .op { color: #0000c0; }&#xD;
.csharpcode .preproc { color: #cc6633; }&#xD;
.csharpcode .asp { background-color: #ffff00; }&#xD;
.csharpcode .html { color: #800000; }&#xD;
.csharpcode .attr { color: #ff0000; }&#xD;
.csharpcode .alt &#xD;
{&#xD;
	background-color: #f4f4f4;&#xD;
	width: 100%;&#xD;
	margin: 0em;&#xD;
}&#xD;
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&#xD;
&#xD;
&lt;p&gt;按照PHP变量的第一定律，a，b，c 必须进行分离，才能保证定律的正确。可以发现，b 和 a 明显是一伙人，就是说，b 和 a 的操作是对称的，他们可以指向同一个zval ，而c 的行为和 a，b 不一样，改变c 需要进行复制。看到这里，我想，如果你看懂了的话，为什么刚开始，贴出来的那段代码的，那个两个count差异如此之大，你也应该明白了。当我和那个网友讨论的时候，它最后说，那这样的话，PHP设计的不好，我完全可以，$c先不进行复制，等c被write 了，再进行复制。看来要说懂一个东西，还是一件很难的事情，好好想想那个PHP第一定律吧。你可以假设不进行分离，c指向同一个zval，所以，c 和 a，b的行为是一样的，是is_ref = 1，所以，c 不会进行复制。最后一种内部执行情况可以用下图表示：&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152378675.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://images.cnblogs.com/cnblogs_com/niniwzw/201104/201104282152432541.png" width="605" height="419" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;我以前也进行搞混这个引用，现在，你可以用那个第一定律来分析所有的情况了。PHP内核分析的文章，以后我还会写一些，如果你想深入了解PHP的某些方面，可以给我留言。&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;最后再补充一点，也是一个隐性的错误。&lt;/p&gt;&#xD;
&#xD;
&lt;pre &gt;function count_bigarray()&#xD;
{&#xD;
    global $bigarray;&#xD;
    &lt;span &gt;return&lt;/span&gt; count($bigarray);&#xD;
}&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt;这里，没有显示的引用，但是这里隐藏了一个引用。PHP会自动创建一个引用全局变量 $bigarray 的代码，如果你在这里使用count，那么这个效率会非常的慢。最好直接通过$GLOBAL 数组进行引用。&lt;/p&gt;  &lt;img src="http://www.cnblogs.com/niniwzw/aggbug/2032223.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/04/28/2032223.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/03/07/1974208.html</id><title type="text">IP快速查找数据库</title><summary type="text">最近一段时间，在研究PHP的共享内存。于是，我想尝试一下共享内存和普通文件相比，能提高多少的性能。本来想简单的把纯真IP数据库导入到共享内存然后查询。但是，后来发现这个数据库设计过于复杂，查询IP速度非常的慢，于是我对这个数据库的结构重新进行了设计。头部：4 * 4 个字节。就记录一个总数//总数|0|0|0索引区: (区域ID的格式：前 24 个bit是区域在文件中的的offset，后8个bit是长度，这样区域的名称长度不能超过255个字节)//start|end|区域ID1|区域ID2//start|end|区域ID1|区域ID2数据区：简单的把所有区域的名称写在这块区域(过滤掉重复的数据</summary><published>2011-03-07T06:03:00Z</published><updated>2011-03-07T06:03:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/03/07/1974208.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/03/07/1974208.html"/><content type="html">&lt;p align="left"&gt;最近一段时间，在研究PHP的共享内存。于是，我想尝试一下共享内存和普通文件相比，能提高多少的性能。本来想简单的把纯真IP数据库导入到共享内存然后查询。&lt;/p&gt;&#xD;
&lt;p align="left"&gt;但是，后来发现这个数据库设计过于复杂，查询IP速度非常的慢，于是我对这个数据库的结构重新进行了设计。&lt;/p&gt;&#xD;
&lt;p align="left"&gt;头部：4 * 4 个字节。就记录一个总数&lt;/p&gt;&#xD;
&lt;p align="left"&gt;//总数|0|0|0&lt;/p&gt;&#xD;
&lt;p align="left"&gt;索引区: (区域ID的格式：前 24 个bit是区域在文件中的的offset，后8个bit是长度，这样区域的名称长度不能超过255个字节)&lt;br /&gt;//start|end|区域ID1|区域ID2&lt;br /&gt;//start|end|区域ID1|区域ID2&lt;br /&gt;数据区：简单的把所有区域的名称写在这块区域(过滤掉重复的数据)&lt;/p&gt;&#xD;
&lt;p align="left"&gt;//string1|string2|string3|string4...&lt;/p&gt;&#xD;
&lt;p align="left"&gt;这样简单化了查找：首先是读取总数，然后确定二分查找区域。查找到数据后，根据区域ID读取区域信息。&lt;/p&gt;&#xD;
&lt;p align="left"&gt;最后，经过测试，&lt;/p&gt;&#xD;
&lt;p align="left"&gt;纯真IP的原版查找速度是 1504个/s&lt;/p&gt;&#xD;
&lt;p align="left"&gt;改进IP查询文件版本查找速度是&amp;nbsp;3977 个/s&lt;/p&gt;&#xD;
&lt;p align="left"&gt;共享内存版本的查找速度是 6325个/s&lt;/p&gt;&#xD;
&lt;p align="left"&gt;因为涉及的文件太多，我不直接在这里拷贝代码，大家去google code 上去下载。&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;a href="http://code.google.com/p/quickip"&gt;http://code.google.com/p/quickip&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;[&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;这个项目的开发计划：&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;0.5 版：发布一个PHP扩展，更加快速的查找IP，目前的速度是每秒 44万次查询。（目前已经开发完成，但是要做兼容linux 和 相关的文档工作）&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;1.0&amp;nbsp;版：发布查询的时候，分离：国家 省 市 区 详细地区 五个部分。（目前省份已经完成，但是市，和 区 还没有处理）&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;后面的版本现在没有计划。&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;]&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;/p&gt;&#xD;
&lt;p&gt;运行： &lt;/p&gt;&#xD;
&lt;p&gt;先 运行：qqwry_tool/build_csv.php ，从纯真IP导出数据 &lt;/p&gt;&#xD;
&lt;p&gt;然后 运行 ：test/bulid_index.php，创建数据和索引 &lt;/p&gt;&#xD;
&lt;p&gt;如果要测试 shmop 请先安装shmop这个PHP扩展,然后运行： shmop/shmop.create.php &lt;/p&gt;&#xD;
&lt;p&gt;接下来运行测试文件： test/ip_find.test.php test/ip_find_qqwry.php &lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;原版的PHP版本的纯真IP有bug，导致不能完整的导出区域2. 我这里没有做修改，&lt;/p&gt;&#xD;
&lt;p align="left"&gt;所以data 目录下面生成的测试结果的区域2，可能会不一致。&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;&amp;nbsp;注意：&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p align="left"&gt;&lt;span style="color: red"&gt;qqwry&amp;nbsp; 这个文件夹 是纯真IP的代码。不是本人写的。要符合纯真IP 的licence。&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/1974208.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/03/07/1974208.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/02/28/1967435.html</id><title type="text">用PHP dom 处理xml,增加或者修改节点</title><summary type="text">今天有人在PHP的群里面问这样一个问题：&amp;lt;?xml version=&amp;quot;1.0&amp;quot; coding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;country&amp;gt;&amp;lt;city&amp;gt;北京&amp;lt;/city&amp;gt;&amp;lt;city&amp;gt;香港&amp;lt;/city&amp;gt;&amp;lt;city&amp;gt;上海&amp;lt;/city&amp;gt;&amp;lt;/country&amp;gt;如果在香港前面加上一个&amp;lt;city&amp;gt;杭州&amp;lt;/city&amp;gt;。今天请假在家，就花了几分钟，解决了这个问题。&amp;lt;?php$xml=&amp;lt;&amp;lt;&amp;lt;XML&amp;lt;?xmlversion=&amp;</summary><published>2011-02-28T13:18:00Z</published><updated>2011-02-28T13:18:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/02/28/1967435.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/02/28/1967435.html"/><content type="html">&#xD;
&lt;p&gt;今天有人在PHP的群里面问这样一个问题：&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;?xml version="1.0" coding="utf-8"?&amp;gt;&lt;br /&gt;&#xD;
&amp;lt;country&amp;gt;&lt;br /&gt;&#xD;
&amp;lt;city&amp;gt;北京&amp;lt;/city&amp;gt;&lt;br /&gt;&#xD;
&amp;lt;city&amp;gt;香港&amp;lt;/city&amp;gt;&lt;br /&gt;&#xD;
&amp;lt;city&amp;gt;上海&amp;lt;/city&amp;gt;&lt;br /&gt;&#xD;
&amp;lt;/country&amp;gt;&lt;/p&gt;&#xD;
&lt;p&gt;如果在香港前面加上一个&amp;lt;city&amp;gt;杭州&amp;lt;/city&amp;gt;。今天请假在家，就花了几分钟，解决了这个问题。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;"&gt;&#xD;
&lt;div&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;php&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$xml&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;XML&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;xml&amp;nbsp;version&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;encoding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;utf-8&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;country&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;北京&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;香港&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;上海&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;country&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&#xD;
XML;&lt;br /&gt;&#xD;
&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;DOMDocument(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;utf-8&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;loadXML(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$xml&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;getElementsByTagName(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$element&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;createElement(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;杭州&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$textNode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;createTextNode(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$city&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;as&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&#xD;
{&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;nodeValue;&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;trim&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;香港&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;insert&amp;nbsp;before&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;parentNode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;insertBefore(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$element&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;parentNode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;insertBefore(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$textNode&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&#xD;
}&lt;br /&gt;&#xD;
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$dom&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;saveXML();&lt;/span&gt;&lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/1967435.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/02/28/1967435.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/01/26/1945745.html</id><title type="text">汉字转拼音问题</title><summary type="text">这是一个非常经典的问题，同时，也是一个很难解决的问题。经典是因为，这个问题非常常见，而且有很多解决方案。难以解决是因为，存在多音字。可以发现很多股票软件都有这问题，比如zgyh 出来的不是中国银行，而是找不到，这是因为，中国银行的 “行” 查出来读的是 "xing" 。我篇文章我只是提供了一个原始的转换方法，就是查表。和你以前看过的算法可能不一样的是，我加了一个二分查找，我看到的一个开源的解决方案是顺序查找的。 关于，多音字问题，我只有一个小规模的多音字表，从所有股票名称里面纠正过来的。解决方案是这样的：在查找拼音的时候，查找一下这个字是否在多音字表里面，如果是，那么查找前后组成的词，来决定读</summary><published>2011-01-26T11:29:00Z</published><updated>2011-01-26T11:29:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/01/26/1945745.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/01/26/1945745.html"/><content type="html">&lt;p&gt;这是一个非常经典的问题，同时，也是一个很难解决的问题。经典是因为，这个问题非常常见，而且有很多解决方案。&lt;/p&gt;&#xD;
&lt;p&gt;难以解决是因为，存在多音字。可以发现很多股票软件都有这问题，比如zgyh 出来的不是中国银行，而是找不到，&lt;/p&gt;&#xD;
&lt;p&gt;这是因为，中国银行的 &amp;#8220;行&amp;#8221; 查出来读的是 "xing" 。我篇文章我只是提供了一个原始的转换方法，就是查表。&lt;/p&gt;&#xD;
&lt;p&gt;和你以前看过的算法可能不一样的是，我加了一个二分查找，我看到的一个开源的解决方案是顺序查找的。&lt;/p&gt;&#xD;
&lt;p&gt;关于，多音字问题，我只有一个小规模的多音字表，从所有股票名称里面纠正过来的。解决方案是这样的：在查找拼音的时候，&lt;/p&gt;&#xD;
&lt;p&gt;查找一下这个字是否在多音字表里面，如果是，那么查找前后组成的词，来决定读什么。如果有谁有完整的多音字表，或者有更好的&lt;/p&gt;&#xD;
&lt;p&gt;解决方案，请给我留言。我一定拜谢。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;" onclick="cnblogs_code_show('08bfd453-46d8-4a66-8699-6b65574afbca')"&gt;&lt;br/&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/&gt;http://www.CodeHighlighter.com/&lt;br/&gt;&lt;br/&gt;--&gt;&lt;span style="color: #000000"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #000000"&gt;php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;初始化&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;string&amp;nbsp;$file&amp;nbsp;拼音代码对应表&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;array&amp;nbsp;把这个对应表映射成array的格式&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_init(&lt;/span&gt;&lt;span style="color: #800080"&gt;$file&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;file&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$file&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;empty&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;))&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Exception&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;load&amp;nbsp;pinyin&amp;nbsp;table&amp;nbsp;error.&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;as&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$k&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;explode&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;\t&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;trim&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(int)&lt;/span&gt;&lt;span style="color: #008080"&gt;trim&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$k&lt;/span&gt;&lt;span style="color: #000000"&gt;]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$item&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;array&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;''&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10248&lt;/span&gt;&lt;span style="color: #000000"&gt;);&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;最后一个拼音的妈是&amp;nbsp;-10247&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;查找一个字符串中，中文字符部分的拼音&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;array&amp;nbsp;$pingyin&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;string&amp;nbsp;$str&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;字符串&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;string&amp;nbsp;$in_encode&amp;nbsp;字符串的编码&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;array&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pingyin_get(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$in_encode&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;gb2312&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #008080"&gt;strtolower&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$in_encode&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;!=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;gb2312&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;iconv&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$in_encode&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;gb2312&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #000000"&gt;!&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;new&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Exception&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;invalid&amp;nbsp;input&amp;nbsp;string.&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin_arr&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;array&lt;/span&gt;&lt;span style="color: #000000"&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$len&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;strlen&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$len&lt;/span&gt;&lt;span style="color: #000000"&gt;;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;++&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;==&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$len&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;break&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_getcode_(&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;]&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;]))&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;!=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;++&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style="color: #800080"&gt;$py&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_find_(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;))&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;!==&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin_arr&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #008080"&gt;substr&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$str&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$i&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;2&lt;/span&gt;&lt;span style="color: #000000"&gt;)]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$py&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin_arr&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;内部函数，通过拼音码查找汉字&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;array&amp;nbsp;$pingyin&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;int&amp;nbsp;$code&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;string/false&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_find_(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$start&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$count&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;count&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$end&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$count&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;||&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$end&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;])&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;no&amp;nbsp;found.&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$start&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$end&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(int)(&lt;/span&gt;&lt;span style="color: #800080"&gt;$start&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$end&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$start&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;/&lt;/span&gt;&lt;span style="color: #000000"&gt;2&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;==&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$count&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;正常情况下，应该是永远都不会执行到这里，但是为了逻辑上清晰点，还是决定写上&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;])&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$code&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingyin&lt;/span&gt;&lt;span style="color: #000000"&gt;[&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;][&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;])&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$start&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$end&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$mid&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;内部函数，通过汉字的第一个字节&amp;nbsp;和&amp;nbsp;第二个字节，得到查找的code&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;char&amp;nbsp;$ch1&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;char&amp;nbsp;$ch2&lt;br /&gt;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;int&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_getcode_(&lt;/span&gt;&lt;span style="color: #800080"&gt;$ch1&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$ch2&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$num1&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;ord&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$ch1&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$num2&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;ord&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$ch2&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$num1&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;159&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$num1&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;248&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$num1&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;256&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$num2&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;65536&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp;基本配置信息&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;define&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;CURRENT_PATH&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;dirname&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff00ff"&gt;__FILE__&lt;/span&gt;&lt;span style="color: #000000"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingin_file&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;CURRENT_PATH&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;/gb-pinyin.table&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pinyin_init(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pingin_file&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #800080"&gt;$py&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pingyin_get(&lt;/span&gt;&lt;span style="color: #800080"&gt;$pinyin&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;中国银行&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;utf-8&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;echo&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;iconv&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;gb2312&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;utf-8&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;print_r&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #800080"&gt;$py&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;&lt;span style="color: #000000"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;echo&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008080"&gt;implode&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;$py&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;拼音表如下：&lt;/p&gt;&#xD;
&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;" onclick="cnblogs_code_show('19de4659-fd6f-4e2f-b43e-4c1131dafefa')"&gt;&lt;br/&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/&gt;http://www.CodeHighlighter.com/&lt;br/&gt;&lt;br/&gt;--&gt;&lt;span style="color: #000000"&gt;a&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20319&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20317&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;an&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20304&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20295&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20292&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ba&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20283&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20265&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ban&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20257&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20242&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20230&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20051&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ben&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20036&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;beng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20032&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20026&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;20002&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;biao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19990&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19986&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19982&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bing&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19976&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19805&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;bu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19784&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ca&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19775&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19774&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;can&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19763&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19756&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19751&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ce&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19746&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ceng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19741&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cha&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19739&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19728&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19725&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19715&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19540&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;che&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19531&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19525&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cheng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19515&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19500&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19484&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19479&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19467&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chuai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19289&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19288&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chuang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19281&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19275&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19270&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;chuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19263&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ci&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19261&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19249&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19243&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19242&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19238&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19235&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19227&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;cuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19224&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;da&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19218&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19212&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19038&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19023&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19018&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;de&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19006&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;deng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;19003&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;di&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18996&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18977&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;diao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18961&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;die&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18952&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ding&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18783&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;diu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18774&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18773&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18763&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;du&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18756&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;duan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18741&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18735&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;dun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18731&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;duo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18722&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;e&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18710&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;en&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18697&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;er&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18696&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fa&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18526&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18518&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18501&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18490&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18478&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;feng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18463&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18448&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18447&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;fu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18446&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ga&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18239&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18237&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18231&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18220&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18211&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ge&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18201&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18184&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18183&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;geng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18181&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;18012&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17997&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17988&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gua&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17970&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;guai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17964&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;guan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17961&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;guang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17950&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17947&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;gun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17931&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;guo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17928&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ha&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17922&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17759&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;han&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17752&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17733&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17730&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;he&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17721&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17703&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17701&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;heng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17697&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17692&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17683&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17676&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hua&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17496&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;huai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17487&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;huan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17482&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;huang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17468&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17454&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;hun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17433&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;huo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17427&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ji&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17417&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jia&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17202&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;17185&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jiang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16983&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jiao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16970&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16942&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16915&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jing&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16733&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jiong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16708&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jiu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16706&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ju&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16689&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;juan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16664&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16657&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;jun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16647&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ka&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16474&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16470&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16465&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16459&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16452&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ke&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16448&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ken&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16433&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;keng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16429&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16427&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16423&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ku&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16419&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kua&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16412&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kuai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16407&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16403&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kuang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16401&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16393&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16220&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;kuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16216&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;la&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16212&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16205&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16202&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16187&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16180&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;le&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16171&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16169&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;leng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16158&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;li&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;16155&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lia&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15959&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15958&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;liang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15944&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;liao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15933&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15920&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15915&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ling&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15903&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;liu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15889&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;long&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15878&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15707&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15701&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lv&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15681&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;luan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15667&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15661&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;lun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15659&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;luo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15652&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ma&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15640&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15631&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;man&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15625&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15454&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15448&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;me&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15436&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15435&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;men&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15419&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;meng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15416&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15408&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15394&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;miao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15385&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15377&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;min&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15375&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ming&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15369&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;miu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15363&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15362&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15183&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;mu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15180&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;na&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15165&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15158&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15153&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15150&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15149&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ne&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15144&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15143&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15141&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;neng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15140&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ni&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15139&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15128&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;niang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15121&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;niao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15119&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15117&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15110&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ning&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;15109&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;niu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14941&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14937&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14933&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nv&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14930&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14929&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14928&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;nuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14926&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;o&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14922&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14921&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pa&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14914&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14908&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14902&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14894&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14889&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14882&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14873&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;peng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14871&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;pi&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14857&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14678&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;piao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14674&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14670&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14668&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ping&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14663&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;po&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14654&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;pu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14645&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14630&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qia&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14594&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14429&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qiang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14407&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qiao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14399&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14384&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14379&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qing&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14368&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qiong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14355&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qiu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14353&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14345&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;quan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14170&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;que&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14159&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;qun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14151&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ran&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14149&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;rang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14145&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;rao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14140&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;re&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14137&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ren&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14135&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;reng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14125&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ri&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14123&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;rong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14122&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;rou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14112&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ru&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14109&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ruan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14099&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;rui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14097&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;run&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14094&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ruo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14092&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sa&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14090&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14087&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;san&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;14083&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13917&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13914&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;se&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13910&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13907&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;seng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13906&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sha&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13905&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13896&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13894&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13878&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13870&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;she&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13859&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13847&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sheng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13831&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13658&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13611&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13601&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shua&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13406&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shuai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13404&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13400&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shuang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13398&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13395&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13391&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;shuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13387&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;si&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13383&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;song&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13367&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13359&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;su&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13356&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;suan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13343&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13340&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;sun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13329&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;suo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13326&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ta&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13318&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13147&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;tan&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13138&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13120&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13107&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;te&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13096&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;teng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13095&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ti&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13091&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13076&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tiao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13068&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13063&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ting&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;13060&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12888&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12875&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12871&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12860&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12858&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12852&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;tuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12849&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wa&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12838&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12831&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12829&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12812&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12802&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12607&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;weng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12597&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12594&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;wu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12585&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12556&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xia&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12359&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xian&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12346&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xiang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12320&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xiao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12300&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xie&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12120&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12099&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xing&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12089&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xiong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12074&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xiu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12067&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12058&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;12039&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11867&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;xun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11861&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ya&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11847&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11831&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11798&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11781&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ye&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11604&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11589&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yin&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11536&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ying&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11358&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11340&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11339&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;you&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11324&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11303&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11097&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11077&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;yun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11067&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;za&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11055&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11052&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11045&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11041&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11038&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;ze&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11024&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zei&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11020&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11019&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zeng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11018&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zha&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;11014&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10838&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10832&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10815&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhao&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10800&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhe&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10790&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhen&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10780&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zheng&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10764&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10587&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10544&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10533&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10519&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhua&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10331&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhuai&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10329&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10328&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhuang&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10322&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10315&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10309&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zhuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10307&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zi&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10296&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zong&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10281&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zou&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10274&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zu&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10270&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zuan&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10262&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zui&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10260&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zun&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10256&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;zuo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;-&lt;/span&gt;&lt;span style="color: #000000"&gt;10254&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/niniwzw/aggbug/1945745.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/01/26/1945745.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/niniwzw/archive/2011/01/20/1940159.html</id><title type="text">多态的内幕--(C++, C)语言两个版本</title><summary type="text">本文通过分析C++编译器生成的汇编代码，分析多态的机制。并实现了一个C语言版本。 在编译性语言里面，多态真的是一个伟大的发明。它可以现在写好代码，编译好，并且可以调用未来的代码。这多少有了点动态的感觉。很多人，也在脚本语言里面抱怨，为什么不提供多态的功能啊。脚本语言里面，一个函数参数，可以传递任何类型，甚至可以通过函数名的字符串调用函数，这样多态的作用就小了很多。对于面向对象来说，最重要的两个概念莫过于 继承 和 多态。继承可以减少代码重复，多态可以减少大量的条件判断，if else switch如果在代码中太多，你的程序应该不怎么面向对象。 废话不说了，先给一个用于分析的程序：代码 Code</summary><published>2011-01-20T06:01:00Z</published><updated>2011-01-20T06:01:00Z</updated><author><name>暮夏</name><uri>http://www.cnblogs.com/niniwzw/</uri></author><link rel="alternate" href="http://www.cnblogs.com/niniwzw/archive/2011/01/20/1940159.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/niniwzw/archive/2011/01/20/1940159.html"/><content type="html">&lt;p&gt;本文通过分析C++编译器生成的汇编代码，分析多态的机制。并实现了一个C语言版本。&lt;/p&gt;&#xD;
&lt;p&gt;在编译性语言里面，多态真的是一个伟大的发明。它可以现在写好代码，编译好，并且可以调用未来的代码。这多少有了点动态的感觉。&lt;/p&gt;&#xD;
&lt;p&gt;很多人，也在脚本语言里面抱怨，为什么不提供多态的功能啊。脚本语言里面，一个函数参数，可以传递任何类型，甚至可以通过函数名的字符串调用函数，&lt;/p&gt;&#xD;
&lt;p&gt;这样多态的作用就小了很多。对于面向对象来说，最重要的两个概念莫过于 继承 和 多态。继承可以减少代码重复，多态可以减少大量的条件判断，if else switch&lt;/p&gt;&#xD;
&lt;p&gt;如果在代码中太多，你的程序应该不怎么面向对象。&lt;/p&gt;&#xD;
&lt;p&gt;废话不说了，先给一个用于分析的程序：&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;" onclick="cnblogs_code_show('d5d98931-b83c-4cd3-b618-82c0c83ec43a')"&gt;&lt;br/&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/&gt;http://www.CodeHighlighter.com/&lt;br/&gt;&lt;br/&gt;--&gt;&lt;span style="color: #000000"&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;iostream&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;std;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;vfun1()&amp;nbsp;{cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;Base::vfun1()&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;endl;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;vfun2()&amp;nbsp;{cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;Base::vfun2()&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;endl;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;vfun3()&amp;nbsp;{cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;Base::vfun3()&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;endl;}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Concrete:&lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;vfun1()&amp;nbsp;{cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;Concrete::vfun1()&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;endl;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;vfun2()&amp;nbsp;{cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;Concrete::vfun2()&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;endl;}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;override_demo2(Base&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;obj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.vfun1();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.vfun2();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.vfun3();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;typedef&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;long&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;point_t;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;32&amp;nbsp;位系统&amp;nbsp;和&amp;nbsp;64&amp;nbsp;位系统上&amp;nbsp;都表示标准指针的长度，但是可能不兼容16位系统，在编译的时候修改一下&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;typedef&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;func)();&lt;br /&gt;&lt;br /&gt;inline&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&amp;nbsp;getvfptr(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;p,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;offset)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;point_t&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;q&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(point_t&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;(point_t&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;)p;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;&amp;nbsp;cout&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;q[0]&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;endl&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;q[1]&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;endl&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;span style="color: #008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;q[2]&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;endl;&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;)(q[offset]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;override_demo(Base&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;obj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;f;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(func)getvfptr(&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;obj,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(func)getvfptr(&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;obj,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(func)getvfptr(&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;obj,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;2&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;main()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Base&amp;nbsp;base_obj;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Concrete&amp;nbsp;concrete_obj;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;override_demo:&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;endl;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo(base_obj);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo(concrete_obj);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cout&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;override_demo2:&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;endl;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo2(base_obj);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo2(concrete_obj);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;这基本上是一个最简单的多态的演示了。我们先来看看 override_demo 这个函数。这个函数没有使用系统使用的多态功能，但是也实现了多态。&lt;/p&gt;&#xD;
&lt;p&gt;通过仔细分析可以发现，这个代码的原理是取出 Base 类的地址，如果，Base 定义了 虚函数，那么会在Base的头部自动插入一个指针，指向虚表数组。&lt;/p&gt;&#xD;
&lt;p&gt;函数调用是通过函数的地址，编译器会在Base类里面插入这个虚表，里面填上按照顺序填上虚函数的地址，在子类中，会复制一份Base的虚表数组，&lt;/p&gt;&#xD;
&lt;p&gt;如果函数被重新定义，那么替换这个虚表中的函数地址，否则就用Base 类里面的地址，在调用虚函数的地方，把obj.vfunc1() 改成 调用虚表中的第一个函数。&lt;/p&gt;&#xD;
&lt;p&gt;这样，即时子类指针转换成了父类指针，但是子类地址指针指向的虚表还是子类的，所以，会调用子类虚表中的第一个函数。&lt;/p&gt;&#xD;
&lt;p&gt;上面的解释太抽象，可以看看汇编的代码：&lt;/p&gt;&#xD;
&lt;p&gt;这是 override_demo2 的汇编代码，很能说明问题：&lt;/p&gt;&#xD;
&lt;p&gt;void override_demo2(Base &amp;amp;obj)&lt;br /&gt;{&lt;br /&gt;00411950&amp;nbsp; push&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ebp&amp;nbsp; &lt;br /&gt;00411951&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ebp,esp &lt;br /&gt;00411953&amp;nbsp; sub&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esp,0C0h &lt;br /&gt;00411959&amp;nbsp; push&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ebx&amp;nbsp; &lt;br /&gt;0041195A&amp;nbsp; push&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi&amp;nbsp; &lt;br /&gt;0041195B&amp;nbsp; push&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edi&amp;nbsp; &lt;br /&gt;0041195C&amp;nbsp; lea&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edi,[ebp-0C0h] &lt;br /&gt;00411962&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ecx,30h &lt;br /&gt;00411967&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,0CCCCCCCCh &lt;br /&gt;0041196C&amp;nbsp; rep stos&amp;nbsp;&amp;nbsp;&amp;nbsp; dword ptr es:[edi] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.fun1();&lt;br /&gt;0041196E&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [obj] &lt;span style="color: red"&gt;//取出obj的地址,就是getvfptr 中p的值&lt;/span&gt;&lt;br /&gt;00411971&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edx,dword ptr [eax] &lt;span style="color: red"&gt;//取出obj第一个元素的值，也就是 getvfptr 中的 *(ponit_t *)p , 取出指针所指向的地址&lt;/span&gt;&lt;br /&gt;00411973&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;00411975&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ecx,dword ptr [obj] &lt;br /&gt;00411978&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [edx] &lt;span style="color: red"&gt;//取出obj第一个元素的指针，指向的第一个元素，也就是 getvfptr 中的 q[0]&lt;/span&gt;&lt;br /&gt;0041197A&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax&amp;nbsp;&amp;nbsp;&lt;span style="color: red"&gt; //调用函数&lt;/span&gt;&lt;br /&gt;0041197C&amp;nbsp; cmp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;0041197E&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @ILT+470(__RTC_CheckEsp) (4111DBh) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.fun2();&lt;br /&gt;00411983&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [obj] &lt;br /&gt;00411986&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edx,dword ptr [eax] &lt;br /&gt;00411988&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;0041198A&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ecx,dword ptr [obj] &lt;br /&gt;0041198D&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [edx+4]&lt;span style="color: red"&gt; //第二个函数&lt;/span&gt;&lt;br /&gt;00411990&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax&amp;nbsp; &lt;br /&gt;00411992&amp;nbsp; cmp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;00411994&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @ILT+470(__RTC_CheckEsp) (4111DBh) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.fun3();&lt;br /&gt;00411999&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [obj] &lt;br /&gt;0041199C&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edx,dword ptr [eax] &lt;br /&gt;0041199E&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;004119A0&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ecx,dword ptr [obj] &lt;br /&gt;004119A3&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax,dword ptr [edx+8] &lt;span style="color: red"&gt;//第三个函数&lt;/span&gt;&lt;br /&gt;004119A6&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eax&amp;nbsp; &lt;br /&gt;004119A8&amp;nbsp; cmp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esi,esp &lt;br /&gt;004119AA&amp;nbsp; call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @ILT+470(__RTC_CheckEsp) (4111DBh) &lt;br /&gt;}&lt;/p&gt;&#xD;
&lt;p&gt;这样看来，调用虚函数的代码并不是很高，但是可以发现，虚函数是不可能内联的，因为，调用它必须通过地址。而且，在之类中必须声明为 &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt;，&lt;/p&gt;&#xD;
&lt;p&gt;否则，这个函数不会放入虚表中，也就不能产生多态了。&lt;/p&gt;&#xD;
&lt;p&gt;依照这个思路，你可以改造成一个C语言的多态的方法。比如你定义一个基结构，它是一个函数指针列表，然后，定义几个子结构，子结构是和基结构一样排序&lt;/p&gt;&#xD;
&lt;p&gt;的函数指针列表。下面是一个例子：&lt;/p&gt;&#xD;
&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;" onclick="cnblogs_code_show('7520979b-d4bb-4d03-899d-dedcfcf12c57')"&gt;&lt;br/&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/&gt;http://www.CodeHighlighter.com/&lt;br/&gt;&lt;br/&gt;--&gt;&lt;span style="color: #000000"&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;stdio.h&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;stdlib.h&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;br /&gt;typedef&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;func();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun3;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;func&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;hello;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc1()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;base_vfunc1\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc2()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;base_vfunc2\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc3()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;base_vfunc3\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;init_base()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&amp;nbsp;base_vtable;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_vtable.vfun1&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_vtable.vfun2&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_vtable.vfun3&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vfunc3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000"&gt;base_vtable;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;child_vfunc3()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;&amp;nbsp;child_vfunc3\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;init_child()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;child;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;base_vtable;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;child&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;malloc(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;sizeof&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_vtable&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;init_base();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;child&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun1&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vtable&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;child&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun2&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;base_vtable&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;child&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun3&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;child_vfunc3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;child&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;hello&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;hello&amp;nbsp;world&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;child;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;free_child(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;ch)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(ch)&amp;nbsp;free(ch);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ch&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;NULL;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;override_demo(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;p)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;)p;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun1();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun2();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;vfun3();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;main()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Child&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;ch&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;init_child();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;struct&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;Base&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;init_base();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;base\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;child\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;override_demo(ch);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(ch&lt;/span&gt;&lt;span style="color: #000000"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;hello);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;free_child(ch);&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;这样，你写一个函数，可以调用不同的代码了。&lt;/p&gt;&#xD;
&lt;p&gt;当然，可能没有面向对象这样直观了。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt; &lt;img src="http://www.cnblogs.com/niniwzw/aggbug/1940159.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/niniwzw/archive/2011/01/20/1940159.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
