{"id":2257,"date":"2017-07-02T14:07:50","date_gmt":"2017-07-02T11:07:50","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=2257"},"modified":"2017-07-05T22:25:03","modified_gmt":"2017-07-05T19:25:03","slug":"e-olymp-923-%d0%b2%d1%80%d0%b5%d0%bc%d1%8f-%d0%b3%d0%be%d0%b4%d0%b0","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=2257","title":{"rendered":"e-olymp 923. \u0412\u0440\u0435\u043c\u044f \u0433\u043e\u0434\u0430"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430\u00a0<a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/923\">e-olymp<\/a><\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u043e\u043c\u0435\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/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: \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e &#8212; \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0441\u044f\u0446\u0430<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0434\u043b\u044f \u0432\u0435\u0441\u0435\u043d\u043d\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 <span id=\"result_box\"><span title=\"\u0412\u0435\u0441\u043d\u0430\"><strong>Spring<\/strong>, \u0434\u043b\u044f \u043b\u0435\u0442\u043d\u0438\u0445 &#8212; <\/span><\/span><span id=\"result_box\"><span title=\"\u041b\u0435\u0442\u043e\"><strong>Summer<\/strong>, \u0434\u043b\u044f \u043e\u0441\u0435\u043d\u043d\u0438\u0445 &#8212; <\/span><\/span><span id=\"result_box\"><span title=\"\u041e\u0441\u0435\u043d\u044c\"><strong>Autumn<\/strong> \u0438 \u0434\u043b\u044f \u0437\u0438\u043c\u043d\u0438\u0445 &#8212; <\/span><\/span><strong><span id=\"result_box\"><span title=\"\u0417\u0438\u043c\u0430\">Winter<\/span><\/span><\/strong><\/p>\n<table style=\"width: 366.24px;height: 149px\">\n<tbody>\n<tr>\n<td style=\"width: 39px;text-align: center\">\u2116<\/td>\n<td style=\"width: 144px;text-align: center\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td style=\"width: 155.24px;text-align: center\">\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 39px;text-align: center\">1<\/td>\n<td style=\"width: 144px;text-align: center\">12<\/td>\n<td style=\"width: 155.24px;text-align: center\">Winter<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 39px;text-align: center\">2<\/td>\n<td style=\"width: 144px;text-align: center\">5<\/td>\n<td style=\"width: 155.24px;text-align: center\">Spring<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 39px;text-align: center\">3<\/td>\n<td style=\"width: 144px;text-align: center\">7<\/td>\n<td style=\"width: 155.24px;text-align: center\">Summer<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 39px;text-align: center\">4<\/td>\n<td style=\"width: 144px;text-align: center\">10<\/td>\n<td style=\"width: 155.24px;text-align: center\">Autumn<\/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\tint monthNumber;\r\n\t\tString seasonName;\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\r\n\t\tmonthNumber = scanner.nextInt();\r\n\t\t\r\n\t\tseasonName = ((monthNumber % 12) &lt; 3) ? \"Winter\" : (monthNumber &lt; 6) ? \"Spring\" : \r\n\t\t\t(monthNumber &lt; 9) ? \"Summer\" : \"Autumn\";\r\n\t\t\r\n\t\tSystem.out.println(seasonName);\t\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>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430\u00a0<a href=\"https:\/\/www.e-olymp.com\/ru\/submissions\/3395412\">e-olymp<\/a><\/p>\n<p><strong>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p style=\"text-align: left\">\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u043c\u0435\u0441\u044f\u0446\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<span class=\"lang:java decode:true crayon-inline\">monthNumber<\/span> \u0442\u0438\u043f\u0430\u00a0<span class=\"lang:java decode:true crayon-inline\">int<\/span>, \u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430 &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <span class=\"lang:java decode:true crayon-inline \">seasonName<\/span>\u00a0 \u0442\u0438\u043f\u0430 <span class=\"lang:java decode:true crayon-inline \">String<\/span>. \u041e\u0431\u044c\u044f\u0432\u0438\u043c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<span class=\"lang:java decode:true crayon-inline \">monthNumber<\/span> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432\u0432\u043e\u0434\u0430. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<span class=\"lang:java decode:true crayon-inline\">seasonName<\/span> \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<span class=\"lang:java decode:true crayon-inline\">monthNumber<\/span>\u00a0 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430: \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430 12 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c 3, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &#171;Winter&#187;; \u0435\u0441\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0441\u044f\u0446\u0430 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c 6 &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &#171;Spring&#187; ; \u0435\u0441\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c 9 &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &#171;Summer&#187;; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &#171;Autumn&#187; \u0432 \u0438\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \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\u00a0<span class=\"lang:java decode:true crayon-inline \">seasonName<\/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 \u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430\u00a0e-olymp \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u043e\u043c\u0435\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0422\u0435\u0441\u0442\u044b \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e &#8212; \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0441\u044f\u0446\u0430 \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0434\u043b\u044f \u0432\u0435\u0441\u0435\u043d\u043d\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 Spring, \u0434\u043b\u044f \u043b\u0435\u0442\u043d\u0438\u0445 &#8212; Summer, \u0434\u043b\u044f \u043e\u0441\u0435\u043d\u043d\u0438\u0445 &#8212; Autumn \u0438 \u0434\u043b\u044f \u0437\u0438\u043c\u043d\u0438\u0445 &#8212; Winter \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 12 Winter 2 5 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=2257\" 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":[3],"tags":[216,240,239,238],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2257"}],"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=2257"}],"version-history":[{"count":10,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2257\/revisions"}],"predecessor-version":[{"id":2271,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2257\/revisions\/2271"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}