{"id":29225,"date":"2016-08-14T12:42:36","date_gmt":"2016-08-14T06:42:36","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=29225"},"modified":"2016-08-14T12:42:49","modified_gmt":"2016-08-14T06:42:49","slug":"%d1%86%d0%b8%d0%ba%d0%bb-for","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=29225","title":{"rendered":"\u0426\u0438\u043a\u043b for"},"content":{"rendered":"<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 for, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0440\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0446\u0438\u043a\u043b\u0430 for \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<blockquote><p>for (exp1; exp2; exp3) statement<\/p><\/blockquote>\n<p>\u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 exp1 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0446\u0438\u043a\u043b\u0430 \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430.<br \/>\nexp2 \u2014 \u0437\u0430\u0434\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430. \u0426\u0438\u043a\u043b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u0441\u044f \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 true.<br \/>\nexp3 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430 (statement). \u041e\u0431\u044b\u0447\u043d\u043e, \u043e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f (\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435) \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre class=\"php\" style=\"font-family: monospace;\"><span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$i<\/span> <span style=\"color: #339933;\">&lt;=<\/span> <span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #009900;\">}<\/span><\/pre>\n<blockquote><p>12345678910<\/p><\/blockquote>\n<p>\u0421\u0447\u0435\u0442 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 1 (\u00a0$i = 1), \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f $i \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 ($i++) \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e $i&lt;=10.<\/p>\n<p>\u0423 \u0446\u0438\u043a\u043b\u0430 <strong>for<\/strong> \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0442\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre class=\"php\" style=\"font-family: monospace;\"><span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">&lt;=<\/span><span style=\"color: #cc66cc;\">9<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\" * \"<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\" = \"<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">*<\/span><span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\"&lt;br&gt;\"<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #009900;\">}<\/span>\r\n<\/pre>\n<blockquote><p>2 * 2 = 4<br \/>\n2 * 3 = 6<br \/>\n2 * 4 = 8<br \/>\n2 * 5 = 10<br \/>\n2 * 6 = 12<br \/>\n2 * 7 = 14<br \/>\n2 * 8 = 16<br \/>\n2 * 9 = 18<\/p><\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0434\u0438\u043d \u0446\u0438\u043a\u043b <strong>for<\/strong> \u0432\u043b\u043e\u0436\u0435\u043d \u0432 \u0434\u0440\u0443\u0433\u043e\u0439:<\/p>\n<pre class=\"php\" style=\"font-family: monospace;\"><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"&lt;table border='1'&gt;\"<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">&lt;=<\/span><span style=\"color: #cc66cc;\">9<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"&lt;td&gt;\"<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">&lt;=<\/span><span style=\"color: #cc66cc;\">9<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\" * \"<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\" = \"<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">*<\/span><span style=\"color: #000088;\">$k<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\"&lt;br&gt;\"<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"&lt;\/td&gt;\"<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"&lt;\/table&gt;\"<\/span><span style=\"color: #339933;\">;<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-29226\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2016\/08\/73465786328976238794.png\" alt=\"73465786328976238794\" width=\"585\" height=\"161\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2016\/08\/73465786328976238794.png 585w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2016\/08\/73465786328976238794-200x55.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2016\/08\/73465786328976238794-500x138.png 500w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 for, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0440\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0446\u0438\u043a\u043b\u0430 for \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: for (exp1; exp2; exp3) statement \u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 exp1 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0446\u0438\u043a\u043b\u0430 \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430. exp2 \u2014 \u0437\u0430\u0434\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430. \u0426\u0438\u043a\u043b \u0431\u0443\u0434\u0435\u0442 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":29227,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[],"class_list":["post-29225","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"views":2299,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/29225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29225"}],"version-history":[{"count":0,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/29225\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/29227"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29225"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}