{"id":2345,"date":"2017-07-02T23:00:19","date_gmt":"2017-07-02T20:00:19","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=2345"},"modified":"2017-07-04T00:41:30","modified_gmt":"2017-07-03T21:41:30","slug":"a302-%d0%ba%d0%be%d0%bb%d0%b8%d1%87%d0%b5%d1%81%d1%82%d0%b2%d0%be-%d1%80%d0%b0%d0%b7%d0%bb%d0%b8%d1%87%d0%bd%d1%8b%d1%85-%d1%86%d0%b8%d1%84%d1%80-%d1%87%d0%b8%d1%81%d0%bb%d0%b0-%d0%b2-%d0%b5%d0%b3","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=2345","title":{"rendered":"A302. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0447\u0438\u0441\u043b\u0430 \u0432 \u0435\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><\/p>\n<p>\u0414\u0430\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $latex N$.\u00a0\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438?<\/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: \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $latex N$<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438\u00a0\u0447\u0438\u0441\u043b\u0430 $latex N$<\/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 style=\"text-align: center\">1234567890<\/td>\n<td style=\"text-align: center\">10<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td style=\"text-align: center\">43352<\/td>\n<td style=\"text-align: center\">4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td style=\"text-align: center\">10101<\/td>\n<td style=\"text-align: center\">2<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td style=\"text-align: center\">1<\/td>\n<td style=\"text-align: center\">1<\/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\tlong n;\r\n\t\tint differentDigitsCount = 0;\r\n\t\tint[] digitsCount = new int[10];\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\r\n\t\tn = scanner.nextLong();\r\n\r\n\t\twhile (n!=0)\r\n\t\t{\r\n\t\t\tdigitsCount[(int)(n%10)]++;\r\n\t\t\tn\/=10;\r\n\t\t}\r\n\t\tfor (int i = 0; i &lt; 10; i++)\r\n\t\t{\r\n\t\t\tif (digitsCount[i] &gt; 0) differentDigitsCount++;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(differentDigitsCount);\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\/9mjvpz\">ideone<\/a><\/p>\n<p><strong>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 $latex N$ \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\">n<\/span>\u00a0 \u0442\u0438\u043f\u0430 <span class=\"lang:java decode:true crayon-inline\">long<\/span>, \u043a\u043e\u0442\u043e\u0440\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 \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, \u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <span class=\"lang:java decode:true crayon-inline\">differentDigitsCount<\/span>\u00a0 \u0442\u0438\u043f\u0430 <span class=\"lang:java decode:true crayon-inline \">int<\/span>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u043c 0. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430 <span class=\"lang:java decode:true crayon-inline\">int<\/span> \u0438\u0437 10 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0446\u0438\u0444\u0440 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e . \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e\u043c 0 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u044f\u0434 &#8212; \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u0440\u044f\u0434 \u0447\u0438\u0441\u043b\u0430, \u0438 \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 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0437\u0430\u0442\u0435\u043c \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 10, \u0447\u0442\u043e\u0431\u044b &#171;\u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c&#187; \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u0440\u044f\u0434. \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 \">differentDigitsCount<\/span>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435.<\/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 \u0414\u0430\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $latex N$.\u00a0\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438? \u0422\u0435\u0441\u0442\u044b \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $latex N$ \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0438\u0444\u0440 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438\u00a0\u0447\u0438\u0441\u043b\u0430 $latex N$ \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 1234567890 10 2 43352 4 3 10101 2 4 1 1 \u041a\u043e\u0434 import java.util.Scanner; public class Main { &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=2345\" 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":[25],"tags":[251],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2345"}],"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=2345"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2345\/revisions"}],"predecessor-version":[{"id":2646,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/2345\/revisions\/2646"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}