{"id":382,"date":"2012-05-17T15:02:00","date_gmt":"2012-05-17T07:02:00","guid":{"rendered":"http:\/\/wangkaixuan.tech\/?p=382"},"modified":"2020-06-06T15:02:31","modified_gmt":"2020-06-06T07:02:31","slug":"%e5%be%aa%e7%8e%af%e8%b5%9b%e6%97%a5%e7%a8%8b%e8%a1%a8","status":"publish","type":"post","link":"http:\/\/www.wangkaixuan.tech\/?p=382","title":{"rendered":"\u5faa\u73af\u8d5b\u65e5\u7a0b\u8868"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/\/\u5faa\u73af\u8d5b\u65e5\u7a0b\u8868\npackage wkx;\n \nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n \npublic class Test {\n\t\n\tprivate static void Copy(int&#91;]&#91;] m,int beg,int mid,int end) {\n\t\tint len=mid-beg+1;\n\t\tfor(int i=beg;i&lt;=mid;i++){\n\t\t\tfor(int j=0;j&lt;len;j++)\n\t\t\t\tm&#91;i+len]&#91;j+len]=m&#91;i]&#91;j];\n\t\t}\n\t\tfor(int i=mid+1;i&lt;=end;i++){\n\t\t\tfor(int j=0;j&lt;len;j++)\n\t\t\t\tm&#91;i-len]&#91;j+len]=m&#91;i]&#91;j];\n\t\t}\n\t}\n\t\n\tprivate static void Table(int&#91;]&#91;] m,int beg,int end) {\n\t\tint size=end-beg+1;\n\t\tif(size==1)\n\t\t\treturn;\n\t\tint mid=size\/2+beg-1;\n\t\tTable(m,beg,mid);\n\t\tTable(m,mid+1,end);\n\t\tCopy(m,beg,mid,end);\n\t}\n\t\n\tprivate static void print(int&#91;]&#91;] m,int size) throws IOException {\n\t\tPrintWriter out=new PrintWriter(new FileWriter(\"C:\\\\Users\\\\Jack\\\\Desktop\\\\output.txt\"));\n\t\tfor(int i=0;i&lt;size;i++){\n\t\t\tfor(int j=0;j&lt;size;j++){\n\t\t\t\tout.print(m&#91;i]&#91;j]);\n\t\t\t}\n\t\t\tout.println();\n\t\t}\n\t\tout.close();\n\t}\n \n\tpublic static void main(String&#91;] args) throws IOException {\n\t\t\n\t\tint&#91;]&#91;] m=new int&#91;100]&#91;100];\n\t\tScanner in=new Scanner(System.in);\n\t\tint size=in.nextInt();\n\t\tint k=(size%2==0?size:size+1);\n\t\tfor(int i=0;i&lt;k;i++)\n\t\t\tm&#91;i]&#91;0]=i+1;\n\t\tTable(m,0,size-1);\n\t\tprint(m,size);\n\t}\n \n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-382","post","type-post","status-publish","format-standard","hentry","category-06-03-play-ground"],"_links":{"self":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=382"}],"version-history":[{"count":0,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/382\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}