{"id":1829,"date":"2017-05-28T11:30:21","date_gmt":"2017-05-28T08:30:21","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=1829"},"modified":"2017-11-26T23:20:25","modified_gmt":"2017-11-26T20:20:25","slug":"mloop-15_%d1%86%d0%b8%d0%ba%d0%bb%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%b8%d0%b5-%d0%b2%d1%8b%d1%87%d0%b8%d1%81%d0%bb%d0%b5%d0%bd%d0%b8%d1%8f","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=1829","title":{"rendered":"MLoop 15. \u0426\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435<\/strong><br \/>\n\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e <span id=\"MathJax-Element-1-Frame\" class=\"MathJax_SVG\"><\/span>\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 $latex f(x)=\\csc x$. \u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<table style=\"height: 154px;width: 302px\">\n<tbody>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 x<\/td>\n<td style=\"width: 83.3667px;text-align: center\">$latex \\varepsilon$<\/td>\n<td style=\"width: 93px;text-align: center\">\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">42<\/td>\n<td style=\"width: 83.3667px;text-align: center\">0.3<\/td>\n<td style=\"width: 93px;text-align: center\">-8.09848e-05<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">8<\/td>\n<td style=\"width: 83.3667px;text-align: center\">0.15<\/td>\n<td style=\"width: 93px;text-align: center\">-0.0117188<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">55.5<\/td>\n<td style=\"width: 83.3667px;text-align: center\">0.04<\/td>\n<td style=\"width: 93px;text-align: center\">-3.50972e-055<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">-12<\/td>\n<td style=\"width: 83.3667px;text-align: center\">0.6<\/td>\n<td style=\"width: 93px;text-align: center\">0.00347222<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 102.633px;text-align: center\">-82<\/td>\n<td style=\"width: 83.3667px;text-align: center\">0.0001<\/td>\n<td style=\"width: 93px;text-align: center\">-3.23677e-08<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"lang:java decode:true \">package lab3; \r\nimport java.util.Scanner;\r\npublic class Lab3 \r\n{ \r\n    public static void main(String[] args) \r\n    {\r\n        Scanner scanIn = new Scanner(System.in);\r\n        double x, e; \r\n        x = scanIn.nextDouble(); \r\n        e = scanIn.nextDouble();\r\n        double sum1 = x; \/\/ \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430  i=0\r\n        double sum2 = -x * x * x \/ 6; \/\/ \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 i=1\r\n        for (int i = 2; Math.abs(1 \/ sum2 - 1 \/ sum1) &gt;= e; i++) \r\n        {\r\n            sum1 = sum2;\r\n            sum2 *= -x * x \/ ((2 * i) * (2 * i + 1)); \r\n        }\r\n\r\n        System.out.println(\"1 \/ sum2: \" + 1 \/ sum2);\r\n    }\r\n}<\/pre>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/strong><br \/>\n\u041a\u043e\u0441\u0435\u043a\u0430\u043d\u0441 \u2014 \u044d\u0442\u043e \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 $latex \\csc x=\\frac{1}{\\sin x}$<span id=\"MathJax-Element-5-Frame\" class=\"MathJax_SVG\"><\/span>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c\u00a0\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044e <span id=\"MathJax-Element-6-Frame\" class=\"MathJax_SVG\"><\/span> \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D1%8F%D0%B4_%D0%A2%D0%B5%D0%B9%D0%BB%D0%BE%D1%80%D0%B0\" target=\"_blank\" rel=\"noopener noreferrer\">\u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0422\u0435\u0439\u043b\u043e\u0440\u0430<\/a>. \u041f\u043e\u043b\u0443\u0447\u0438\u043c, \u0447\u0442\u043e $latex \\sin x=x-\\frac{{x}^{3}}{3!}+\\frac{{x}^{5}}{5!}-\\dots=\\sum_{n=0}^{\\propto}\\frac{{-1}^{n}\\times{x}^{2n+1}}{\\left(2n+1\\right)!}$<span id=\"MathJax-Element-7-Frame\" class=\"MathJax_SVG\"><\/span>. \u0421\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0435\u0439, \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 $latex \\frac{a_n}{a_{n-1}}=\\frac{\\frac{{-1}^{n}\\times{a}^{2n+1}}{\\left(2n+1 \\right)!}}{\\frac{{-1}^{n-1}\\times{a}^{2n-1}}{\\left(2n-1 \\right)!}}=\\frac{\\left( -1\\right){a}^{2}}{2n\\times\\left( 2n+1\\right)}$\u00a0 <span id=\"MathJax-Element-8-Frame\" class=\"MathJax_SVG\"><\/span>. \u00a0\u0411\u0443\u0434\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c <span id=\"MathJax-Element-9-Frame\" class=\"MathJax_SVG\"><\/span>-\u0433\u043e \u0438\u00a0 <span id=\"MathJax-Element-10-Frame\" class=\"MathJax_SVG\"><\/span>-\u0433\u043e \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u00a0\u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><a href=\"https:\/\/ideone.com\/arCEkS\">Ideone.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 $latex f(x)=\\csc x$. \u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 x $latex \\varepsilon$ \u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 42 0.3 -8.09848e-05 8 0.15 -0.0117188 55.5 0.04 -3.50972e-055 -12 0.6 0.00347222 -82 0.0001 -3.23677e-08 package lab3; import java.util.Scanner; public class Lab3 { public static void main(String[] args) { Scanner scanIn = new Scanner(System.in); &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=1829\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":91,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[212,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1829"}],"collection":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/users\/91"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1829"}],"version-history":[{"count":10,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions"}],"predecessor-version":[{"id":3235,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions\/3235"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}