{"id":2320,"date":"2017-07-02T19:46:16","date_gmt":"2017-07-02T16:46:16","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=2320"},"modified":"2017-07-05T21:14:14","modified_gmt":"2017-07-05T18:14:14","slug":"ms2-%d1%81%d1%83%d0%bc%d0%bc%d0%b0-%d1%87%d0%b8%d1%81%d0%b5%d0%bb-%d0%b2-%d0%bf%d0%be%d1%82%d0%be%d0%ba%d0%b5","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=2320","title":{"rendered":"MS2. \u0421\u0443\u043c\u043c\u0430 \u0447\u0438\u0441\u0435\u043b \u0432 \u043f\u043e\u0442\u043e\u043a\u0435"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><\/p>\n<p>\u0421\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0447\u0438\u0441\u0435\u043b \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<p><strong>\u0422\u0435\u0441\u0442\u044b<\/strong><\/p>\n<p>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043f\u043e\u0442\u043e\u043a \u0447\u0438\u0441\u0435\u043b<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0441\u0443\u043c\u043c\u0430 \u0447\u0438\u0441\u0435\u043b \u0432 \u043f\u043e\u0442\u043e\u043a\u0435<\/p>\n<table>\n<tbody>\n<tr>\n<td>\u2116<\/td>\n<td>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1 2 4<\/td>\n<td>7.0<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>0 0 0 -3<\/td>\n<td>-3.0<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>12.4 25.545<\/td>\n<td>37.945<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>-4.34 3.764 2.3<\/td>\n<td>1.724<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u041a\u043e\u0434<\/strong><\/p>\n<pre class=\"lang:java decode:true\">import java.util.Scanner;\r\n\r\npublic class Main\r\n{\r\n\tpublic static void main (String[] args)\r\n\t{\r\n\t\tdouble x, sum = 0;\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\r\n\t\twhile ( scanner.hasNext() )\r\n\t\t{\r\n\t\t\tx = scanner.nextDouble();\r\n\t\t\tsum += x;\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}\r\n}<\/pre>\n<p>\u041a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430\u00a0<a href=\"http:\/\/ideone.com\/IM2w72\">ideone<\/a><\/p>\n<p><strong>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0431\u044c\u044f\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 <span class=\"lang:java decode:true crayon-inline\">double<\/span>:\u00a0<span class=\"lang:java decode:true crayon-inline \">x<\/span>\u00a0 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u00a0<span class=\"lang:java decode:true crayon-inline \">sum<\/span>\u00a0 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u043c\u043c\u044b, \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0447\u0438\u0441\u043b\u043e\u043c 0. \u0421\u0443\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<span class=\"lang:java decode:true crayon-inline\">sum<\/span> \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430\u00a0<span class=\"lang:java decode:true crayon-inline \">hasNext()<\/span>\u00a0 \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<span class=\"lang:java decode:true crayon-inline\">Scanner<\/span>.\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b &#8212; \u0432\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <span class=\"lang:java decode:true crayon-inline \">sum<\/span>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0421\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0447\u0438\u0441\u0435\u043b \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0422\u0435\u0441\u0442\u044b \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043f\u043e\u0442\u043e\u043a \u0447\u0438\u0441\u0435\u043b \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0441\u0443\u043c\u043c\u0430 \u0447\u0438\u0441\u0435\u043b \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 \u2116 \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 1 1 2 4 7.0 2 0 0 0 -3 -3.0 3 12.4 25.545 37.945 4 -4.34 3.764 2.3 1.724 \u041a\u043e\u0434 import java.util.Scanner; public class Main { public static void main &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=2320\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":98,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[147],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2320"}],"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\/98"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2320"}],"version-history":[{"count":5,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2320\/revisions"}],"predecessor-version":[{"id":2361,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2320\/revisions\/2361"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}