{"id":186,"date":"2018-05-20T11:11:09","date_gmt":"2018-05-20T03:11:09","guid":{"rendered":"https:\/\/dragonyue.fortiddns.com\/blog\/?p=186"},"modified":"2022-07-31T13:04:52","modified_gmt":"2022-07-31T05:04:52","slug":"java-uva10008","status":"publish","type":"post","link":"https:\/\/dragonyue.fortiddns.com\/blog\/java-uva10008\/","title":{"rendered":"Java &#8211; UVA10008"},"content":{"rendered":"<pre class=\"lang:java decode:1 \" >\r\nimport java.util.Scanner;\r\n\r\n\/**\r\n * UVA10008\r\n *\/\r\npublic class UVA10008 {\r\n\r\n    public static void main(String[] args) {\r\n        Scanner sc = new Scanner(System.in);\r\n        String temp = sc.nextLine();\r\n        temp = temp.replace(&quot; &quot;, &quot;&quot;);\r\n        int num = Integer.parseInt(temp);\r\n        int[] count = new int[26];\r\n        int max = 0;\r\n        for (int i = 0; i &lt; num; i++) {\r\n            temp = sc.nextLine().toLowerCase();\r\n            for (int j = 0; j &lt; temp.length(); j++) {\r\n                if (temp.charAt(j) &lt;= 122 &amp;&amp; temp.charAt(j) &gt;= 97) {\r\n                    count[temp.charAt(j) - 97]++;\r\n                    if (count[temp.charAt(j) - 97] &gt; max)\r\n                        max = count[temp.charAt(j) - 97];\r\n                }\r\n            }\r\n        }\r\n\r\n        for (int i = max; i &gt; 0; i--)\r\n            for (int j = 0; j &lt; count.length; j++) {\r\n                if (i == count[j])\r\n                    System.out.println((char) (j + 65) + &quot; &quot; + count[j]);\r\n            }\r\n        sc.close();\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import java.util.Scanner; \/** * UVA10008 *\/ public clas [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":1,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":417,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts\/186\/revisions\/417"}],"wp:attachment":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}