{"id":1672,"date":"2016-11-23T22:18:40","date_gmt":"2016-11-23T19:18:40","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=1672"},"modified":"2016-12-20T21:37:24","modified_gmt":"2016-12-20T18:37:24","slug":"%d0%b0136%d0%b7","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=1672","title":{"rendered":"\u0410136\u0437"},"content":{"rendered":"<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430<\/strong> \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c: \u00a0\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, x+=[\u0437\u043d\u0430\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438\/\u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430]*[\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430]\/[\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430].<\/p>\n<p><strong>\u0422\u0435\u0441\u0442<\/strong><\/p>\n<table style=\"width: 617px\">\n<tbody>\n<tr>\n<td style=\"width: 33px\">n<\/td>\n<td style=\"width: 226px\">\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/td>\n<td style=\"width: 340px\">sum(wolframalpha)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33px\">2<\/td>\n<td style=\"width: 226px\">0 0<\/td>\n<td style=\"width: 340px\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33px\">2<\/td>\n<td style=\"width: 226px\">5 8<\/td>\n<td style=\"width: 340px\">-1<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33px\">3<\/td>\n<td style=\"width: 226px\">5 8 12<\/td>\n<td style=\"width: 340px\">-3<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33px\">4<\/td>\n<td style=\"width: 226px\">1 2 3 24<\/td>\n<td style=\"width: 340px\">\u00a01<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33px\">\u00a05<\/td>\n<td style=\"width: 226px\">\u00a00 0 0 2 3<\/td>\n<td style=\"width: 340px\">\u00a00, 058333<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong><\/h3>\n<pre class=\"lang:java decode:true\">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception{\r\n                Scanner in = new Scanner(System.in);\r\n                int n = in.nextInt();\r\n                int[] a = new int[n];\r\n                for (int i=0; i&lt;n; i++){\r\n                     a[i] = in.nextInt();\r\n                }\r\n                double sum=0;\r\n                int f=1;\r\n                for (int i=1; i&lt;=n; i++){\r\n                     f*=i;\r\n                     double sign = (i%2==0) ? 1 : -1;\r\n                     sum+=(sign*a[i-1])\/f;\r\n                }\r\n                System.out.println(sum);\r\n\t}\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/strong><br \/>\n\u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u0438, \u0442\u0430\u043a \u00a0\u043a\u0430\u043a \u00a0\u044d\u0442\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <img decoding=\"async\" class=\"latex\" title=\"sign\" src=\"http:\/\/s0.wp.com\/latex.php?latex=sign&amp;bg=292625&amp;fg=b29d85&amp;s=0\" alt=\"sign\" \/>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0437\u043d\u0430\u043a\u043e\u043c. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u00a0\u0447\u0451\u0442\u043d\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430 2 \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u0442\u043a\u0430, \u0442\u043e \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u043a <img decoding=\"async\" class=\"latex\" title=\"+\" src=\"http:\/\/s0.wp.com\/latex.php?latex=%2B&amp;bg=292625&amp;fg=b29d85&amp;s=0\" alt=\"+\" \/><\/p>\n<h2><strong>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 Ideone<\/strong><\/h2>\n<p><a href=\"http:\/\/ideone.com\/ZB6a2C\">http:\/\/ideone.com\/ZB6a2C<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c: \u00a0\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, x+=[\u0437\u043d\u0430\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438\/\u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430]*[\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430]\/[\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430]. \u0422\u0435\u0441\u0442 n \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c sum(wolframalpha) 2 0 0 0 2 5 8 -1 3 5 8 12 -3 4 1 2 3 24 \u00a01 \u00a05 \u00a00 0 0 2 3 \u00a00, 058333 \u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b import &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=1672\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":89,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[147,205,140],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1672"}],"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\/89"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1672"}],"version-history":[{"count":8,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1672\/revisions"}],"predecessor-version":[{"id":1798,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1672\/revisions\/1798"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}