{"id":2835,"date":"2017-07-06T12:20:21","date_gmt":"2017-07-06T09:20:21","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=2835"},"modified":"2017-07-07T06:41:32","modified_gmt":"2017-07-07T03:41:32","slug":"%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-%e2%84%961","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=2835","title":{"rendered":"e-olymp 906"},"content":{"rendered":"<h1>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0441\u0443\u043c\u043c\u0443 \u0446\u0438\u0444\u0440 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/h1>\n<p>\u0426\u0435\u043b\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &#8212; [latex]x[\/latex].<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/h1>\n<p>\u0421\u0443\u043c\u043c\u0430 \u0446\u0438\u0444\u0440 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 &#8212; [latex]sum[\/latex].<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table style=\"width: 253px\">\n<tbody>\n<tr style=\"height: 48px\">\n<td style=\"width: 20px;height: 48px\">\u2116<\/td>\n<td style=\"width: 126px;height: 48px\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td style=\"width: 89px;height: 48px\">\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr style=\"height: 22.5px\">\n<td style=\"width: 20px;height: 22.5px\">1<\/td>\n<td style=\"width: 126px;height: 22.5px\">234<\/td>\n<td style=\"width: 89px;height: 22.5px\">9<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 20px;height: 24px\">2<\/td>\n<td style=\"width: 126px;height: 24px\">489<\/td>\n<td style=\"width: 89px;height: 24px\">21<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 20px;height: 24px\">3<\/td>\n<td style=\"width: 126px;height: 24px\">31<\/td>\n<td style=\"width: 89px;height: 24px\">4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/h1>\n<pre class=\"lang:java decode:true\">class ThirdLab\r\n{\r\n\tpublic static void main (String[] args)\r\n\t{\r\n\t\tint x;\r\n\t\tint sum = 0;\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tx = input.nextInt();\r\n\t\twhile((x%10)&gt;0){\r\n\t\tsum+= x%10;\t\r\n\t\tx\/=10;\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}\r\n}<\/pre>\n<h1>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/h1>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430\u00a0<span class=\"lang:java decode:true crayon-inline \">int<\/span>\u00a0&#8212;\u00a0<span class=\"lang:java decode:true crayon-inline \">x<\/span>\u00a0 \u0438\u00a0<span class=\"lang:java decode:true crayon-inline \">sum<\/span>\u00a0. \u0412\u0432\u043e\u0434\u0438\u043c \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0446\u0435\u043b\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e\u00a0<span class=\"lang:java decode:true crayon-inline \">x<\/span>\u00a0. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0446\u0438\u043a\u043b\u00a0<span class=\"lang:java decode:true crayon-inline \">while<\/span>\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u00a0<span class=\"lang:java decode:true crayon-inline \">sum<\/span>\u00a0\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<span class=\"lang:java decode:true crayon-inline \">x<\/span>\u00a0 \u043d\u0430 10 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0440\u0430\u0432\u043d\u044b\u043c \u043d\u0443\u043b\u044e. \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<span class=\"lang:java decode:true crayon-inline \">sum<\/span>\u00a0\u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<span class=\"lang:java decode:true crayon-inline \">System.out.println()<\/span>\u00a0.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0441\u0443\u043c\u043c\u0443 \u0446\u0438\u0444\u0440 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0426\u0435\u043b\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &#8212; [latex]x[\/latex]. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0421\u0443\u043c\u043c\u0430 \u0446\u0438\u0444\u0440 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 &#8212; [latex]sum[\/latex]. \u0422\u0435\u0441\u0442\u044b \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 234 9 2 489 21 3 31 4 \u0420\u0435\u0448\u0435\u043d\u0438\u0435: class ThirdLab { public static void main (String[] args) { int x; int sum &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=2835\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":92,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[41,147,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2835"}],"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\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2835"}],"version-history":[{"count":7,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2835\/revisions"}],"predecessor-version":[{"id":2955,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2835\/revisions\/2955"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}