{"id":64,"date":"2018-03-26T11:47:39","date_gmt":"2018-03-26T03:47:39","guid":{"rendered":"http:\/\/dragonyue.fortiddns.com\/blog\/?p=64"},"modified":"2018-03-26T11:48:43","modified_gmt":"2018-03-26T03:48:43","slug":"java-2018-03-07-hw","status":"publish","type":"post","link":"https:\/\/dragonyue.fortiddns.com\/blog\/java-2018-03-07-hw\/","title":{"rendered":"Java 2018-03-07 HW"},"content":{"rendered":"<pre class=\"prettyprint linenums\">\r\nimport java.text.DecimalFormat;\r\nimport java.util.Scanner;\r\npublic class Java_107_3_7_HW1\r\n{\r\n\r\n\tpublic static void main(String[] args)\r\n\t{\r\n\t\t\/\/ TODO \u81ea\u52d5\u7522\u751f\u7684\u65b9\u6cd5 Stub\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tint members[][] = new int[5][3];\r\n\t\tint input;\r\n\t\tdouble chi = 0, eng = 0, math = 0;\r\n\t\tfor (int i = 0; i < members.length; i++)\r\n\t\t{\r\n\t\t\tfor (int j = 0; j < members[i].length; j++)\r\n\t\t\t{\r\n\t\t\t\tinput = scanner.nextInt();\r\n\t\t\t\tmembers[i][j] = input;\r\n\t\t\t\tif (j == 0)\r\n\t\t\t\t\tchi += input;\r\n\t\t\t\tif (j == 1)\r\n\t\t\t\t\teng += input;\r\n\t\t\t\tif (j == 2)\r\n\t\t\t\t\tmath += input;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"NO\\tChinese\\tEnglish\\tMathematic\");\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tfor (int i = 0; i < members.length; i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(i + 1);\r\n\t\t\tfor (int j = 0; j < members[i].length; j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"\\t\" + members[i][j]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t\tchi \/= members.length;\r\n\t\teng \/= members.length;\r\n\t\tmath \/= members.length;\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tDecimalFormat df = new DecimalFormat(\"0.00\");\r\n\t\tSystem.out.print(String.format(\"Average\\t%s\\t%s\\t%s\", df.format(chi),\r\n\t\t\t\tdf.format(eng), df.format(math)));\r\n\t}\r\n\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import java.text.DecimalFormat; import java.util.Scanne [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts\/64","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=64"}],"version-history":[{"count":0,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonyue.fortiddns.com\/blog\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}