{"id":484,"date":"2018-04-04T01:58:13","date_gmt":"2018-04-03T17:58:13","guid":{"rendered":"https:\/\/colliot.me\/?p=484"},"modified":"2018-04-04T02:27:23","modified_gmt":"2018-04-03T18:27:23","slug":"%e4%b8%80%e4%b8%aapascal%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/colliot.org\/en\/2018\/04\/%e4%b8%80%e4%b8%aapascal%e7%a8%8b%e5%ba%8f\/","title":{"rendered":"(\u4e2d\u6587) \u4e00\u4e2aPASCAL\u7a0b\u5e8f"},"content":{"rendered":"<p class=\"qtranxs-available-languages-message qtranxs-available-languages-message-en\">Sorry, this entry is only available in <a href=\"https:\/\/colliot.org\/zh\/wp-json\/wp\/v2\/posts\/484\" class=\"qtranxs-available-language-link qtranxs-available-language-link-zh\" title=\"\u4e2d\u6587\">\u4e2d\u6587<\/a>. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.<\/p><p><\/p>\n<div class=\"pcs-article-box_ptkaiapt4bxy_baiduscarticle\">\n<div class=\"pcs-article-c_ptkaiapt4bxy_baiduscarticle\">\n<div id=\"detailArticleContent_ptkaiapt4bxy_baiduscarticle\" class=\"pcs-article-content_ptkaiapt4bxy_baiduscarticle\">\n<p>\u81ea\u5df1\u7f16\u7684<\/p>\n<pre class=\"prettyprint lang-pascal\" data-start-line=\"1\" data-visibility=\"visible\" data-highlight=\"\" data-caption=\"\">program sequence(input,output);\r\n{$r-,s-,q-}\r\nvar\r\n       a:array[1..10] of 0..1;\r\n       input,output:text;\r\n       x,y,n,w:longint;\r\n       i:longint;\r\n       s:longint;\r\nfunction xny(a,b,c:longint):longint;\r\n       var\r\n           tv:integer;\r\n       begin\r\n           c:=1;\r\n           for tv:=1 to b do\r\n               c:=c*a;\r\n       xny:=c;\r\n       end;\r\nbegin\r\n       for i:=1 to 10 do\r\n           a[i]:=0;\r\n       s:=0;\r\n       assign(input,'sequence.in');\r\n       reset(input);\r\n       readln(input,n,w);\r\n       close(input);\r\n       i:=10;\r\n       while w&gt;0 do\r\n           begin\r\n               a[i]:=w mod 2;\r\n               w:=w div 2;\r\n               i:=i-1;\r\n           end;\r\n               for i:=1 to 10 do writeln(a[i]);\r\n       for i:=10 downto 1 do\r\n               begin\r\n                   if a[i]=1 then s:=s+xny(n,10-i,y);\r\n               end;\r\n        assign(output,'sequence.out');\r\n        rewrite(output);\r\n        writeln(output,s);\r\n        close(output);\r\nend.\r\n<\/pre>\n<p>\u54ea\u4f4d\u5927\u867e\u4f18\u5316\u4e00\u4e0b<a href=\"http:\/\/dict.cn\/search\/?q=input\" target=\"_blank\" rel=\"noopener\">input: [&#8216;input] n. \u8f93\u5165<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"detailArticleFooter_ptkaiapt4bxy_baiduscarticle\" class=\"footer\"><\/div>\n<div style=\"text-align: right;\">2006-12-20<\/div>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in \u4e2d\u6587. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language. \u81ea\u5df1\u7f16\u7684 program sequence(input,output); {$r-,s-,q-} var a:array[1..10] of 0..1; input,output:text; x,y,n,w:longint; i:longint; s:longint; function xny(a,b,c:longint):longint; var tv:integer; begin c:=1; for tv:=1 to b &hellip; <a href=\"https:\/\/colliot.org\/en\/2018\/04\/%e4%b8%80%e4%b8%aapascal%e7%a8%8b%e5%ba%8f\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;(\u4e2d\u6587) \u4e00\u4e2aPASCAL\u7a0b\u5e8f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[51,35,52,50],"tags":[],"_links":{"self":[{"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/posts\/484"}],"collection":[{"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":0,"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"wp:attachment":[{"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/colliot.org\/en\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}