{"id":233459,"date":"2014-08-15T14:05:02","date_gmt":"2014-08-15T10:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=233459"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=233459","title":{"rendered":"<span class=\"post_title\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a: strcmp \u0438\u043b\u0438 \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e. Benchmark<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u042f \u0438\u0441\u043a\u0430\u043b \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435\u00bb  <\/p>\n<pre><code class=\"cpp\">strcmp(in, &quot;first&quot;) == 0 <\/code><\/pre>\n<p>  \u0438\u043b\u0438  <\/p>\n<pre><code class=\"cpp\">strlen(in) == 5 && in[0] == 'f' && in[1] == 'i' && in[2] == 'r' && in[3] == 's' && in[4] == 't' <\/code><\/pre>\n<p>  \u0418, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043d\u0430\u0448\u0451\u043b\u2026<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u00ab\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u043c\u00bb. \u0412\u0441\u0435\u0433\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u043f\u044f\u0442\u044c: \u00abfirst\u00bb, \u00ablast\u00bb, \u00abeven\u00bb, \u00abodd\u00bb, \u00abexit\u00bb, \u043f\u0440\u0438\u0447\u0451\u043c \u043f\u043e \u00abexit\u00bb \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0417\u0430 \u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u0447\u0442\u043e \u044f \u0438\u0437\u0443\u0447\u0430\u044e C, \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e: \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>strcmp<\/code> \u0438 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e (\u0430\u043a\u0430 \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e). \u041c\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0438 \u043a\u043e\u043b\u043b\u0435\u0433 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c. \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u0435\u043d benchmark.<\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/h4>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 <code>strcmp<\/code>, \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c <code>bench_str<\/code>:  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;string.h&gt;  int main() {     char in[100] = &quot;&quot;;      while (scanf(&quot;%s&quot;, in)) {         if (strcmp(in, &quot;first&quot;) == 0) {             printf(&quot;F\\n&quot;);         } else if (strcmp(in, &quot;last&quot;) == 0) {             printf(&quot;L\\n&quot;);         } else if (strcmp(in, &quot;odd&quot;) == 0) {             printf(&quot;O\\n&quot;);         } else if (strcmp(in, &quot;even&quot;) == 0) {             printf(&quot;E\\n&quot;);         } else if (strcmp(in, &quot;exit&quot;) == 0) {             return 0;         } else {             printf(&quot;unknown\\n&quot;);         }     }      return 0; } <\/code><\/pre>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c <code>bench_char<\/code>:  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;string.h&gt;  int main() {     char in[100] = &quot;&quot;;      while (scanf(&quot;%s&quot;, in)) {         if (strlen(in) == 5 && in[0] == 'f' && in[1] == 'i' && in[2] == 'r' && in[3] == 's' && in[4] == 't') {             printf(&quot;F\\n&quot;);         } else if (strlen(in) == 4 && in[0] == 'l' && in[1] == 'a' && in[2] == 's' && in[3] == 't') {             printf(&quot;L\\n&quot;);         } else if (strlen(in) == 3 && in[0] == 'o' && in[1] == 'd' && in[2] == 'd') {             printf(&quot;O\\n&quot;);         } else if (strlen(in) == 4 && in[0] == 'e' && in[1] == 'v' && in[2] == 'e' && in[3] == 'n') {             printf(&quot;E\\n&quot;);         } else if (strlen(in) == 4 && in[0] == 'e' && in[1] == 'x' && in[2] == 'i' && in[3] == 't') {             return 0;         } else {             printf(&quot;unknown\\n&quot;);         }     }      return 0; } <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u043d\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e:  <\/p>\n<pre><code class=\"bash\">$ gcc -Wall -o .\/bin\/bench_str bench_str.c && .\/bin\/bench_str some unknown first F last L exit  $ gcc -Wall -o .\/bin\/bench_char bench_char.c && .\/bin\/bench_char any  unknown odd O even E exit <\/code><\/pre>\n<h4>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u0430\u0448 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0438\u0437\u0440\u044f\u0434\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a. \u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c 10M \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434. \u041d\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u0445 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0442\u0430\u043a \u0437\u0430\u043c\u0435\u0442\u043d\u0430, \u0438 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043e\u0442\u0436\u0438\u0440\u0430\u044e\u0449\u0438\u0445 \u0432\u0430\u0448 CPU, \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u0435\u0435.<\/p>\n<p>  \u042f \u0441\u0434\u0435\u043b\u0430\u043b <code>make_input.php<\/code>:  <\/p>\n<pre><code class=\"php\">&lt;?php $variants = array(     &quot;first&quot;,     &quot;last&quot;,     &quot;even&quot;,     &quot;odd&quot;,     &quot;final&quot;,     &quot;long&quot;,     &quot;event&quot;,     &quot;omnipotent&quot;,     &quot;bad&quot;,     &quot;very bad&quot;,     &quot;ugly&quot;, );  for ($i = 0; $i &lt; 10000000; $i++) {     $str = $variants[array_rand($variants)];     echo $str . PHP_EOL; }  echo &quot;exit&quot; . PHP_EOL; <\/code><\/pre>\n<pre><code class=\"bash\">$ php make_input.php &gt;\/tmp\/input <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 input \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e <code>while (scanf(&quot;%s&quot;, in))<\/code>, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u0434\u0451\u0442 \u00abexit\u00bb \u2014 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a: \u0435\u0441\u0442\u044c \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u043e \u0434\u043b\u0438\u043d\u0435, \u0435\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u00ab\u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445\u00bb \u0431\u0443\u043a\u0432, \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u00ab\u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438\u00bb \u043a\u043e\u043d\u0446\u0430\u043c\u0438, \u043d\u0443 \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<h4>Push the button, Max!<\/h4>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c! \u042f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043b \u0432\u044b\u0432\u043e\u0434 \u0432 <code>\/dev\/null<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d: \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u043d\u043e\u0441\u0438\u0442 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043b\u0438 \u0434\u0432\u0430.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"bash\">$ time .\/bin\/bench_char &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m2.962s user    0m2.908s sys     0m0.048s <\/code><\/pre>\n<p>  I&#8217;d like to see the Great Leslie try THAT one! \u00a9<\/p>\n<p>  \u041d\u0430 \u0441\u0446\u0435\u043d\u0435 <code>strcmp<\/code>:  <\/p>\n<pre><code class=\"bash\">$ time .\/bin\/bench_str &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m2.495s user    0m2.448s sys     0m0.036s <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f: <code>strcmp<\/code> \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 \u043f\u043e\u043b\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0430 \u044d\u0442\u043e \u043e\u043a\u043e\u043b\u043e 20%! \u0418 \u044f \u0434\u0430\u0436\u0435 \u043c\u043e\u043b\u0447\u0443 \u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0435\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e <code>strcmp<\/code> \u043f\u0430\u0434\u0430\u0435\u0442 \u0434\u043e 15%:  <\/p>\n<pre><code class=\"bash\">$ time .\/bin\/bench_char &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m2.026s user    0m1.992s sys     0m0.028s  $ time .\/bin\/bench_str &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m1.739s user    0m1.720s sys     0m0.012s <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a, \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f bench_char \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0430 \u0432\u043e\u0442 bench_str \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043b\u044c\u0448\u0435.\u0412 \u0446\u0435\u043b\u043e\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e <code>strcmp<\/code> \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e 10%:  <\/p>\n<pre><code class=\"bash\">$ time .\/bin\/bench_char &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m2.986s user    0m2.936s sys     0m0.044s  $ time .\/bin\/bench_str &lt;\/tmp\/input 1&gt;\/dev\/null  real    0m2.722s user    0m2.676s sys     0m0.032s <\/code><\/pre>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u0443:<\/p>\n<p>  Case #1: \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438<br \/>  Case #2: \u043c\u0438\u043a\u0441<br \/>  Case #3: \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043d\u0435 \u043f\u0440\u0430\u0432 \u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u2014 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0437\u043e\u0440.<br \/>  \u041d\u043e \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a, \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u0443\u043f\u0435\u0440\u0441\u043a\u0438!<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/233459\/\"> http:\/\/habrahabr.ru\/post\/233459\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u042f \u0438\u0441\u043a\u0430\u043b \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435\u00bb  <\/p>\n<pre><code class=\"cpp\">strcmp(in, &quot;first&quot;) == 0 <\/code><\/pre>\n<p>  \u0438\u043b\u0438  <\/p>\n<pre><code class=\"cpp\">strlen(in) == 5 &#038;& in[0] == 'f' &#038;& in[1] == 'i' &#038;& in[2] == 'r' &#038;& in[3] == 's' &#038;& in[4] == 't' <\/code><\/pre>\n<p>  \u0418, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043d\u0430\u0448\u0451\u043b\u2026  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-233459","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233459"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233459\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}