锘??xml version="1.0" encoding="utf-8" standalone="yes"?>香蕉久久夜色精品国产小说,日本久久久久久久久久,久久精品午夜一区二区福利http://www.shnenglu.com/Icho/Some birds aren`t meant to be caged, their feathers are just too bright... ...zh-cnWed, 07 May 2025 18:26:39 GMTWed, 07 May 2025 18:26:39 GMT60SGU 118 Digital Roothttp://www.shnenglu.com/Icho/archive/2010/08/19/123977.htmlBrianBrianThu, 19 Aug 2010 07:35:00 GMThttp://www.shnenglu.com/Icho/archive/2010/08/19/123977.htmlhttp://www.shnenglu.com/Icho/comments/123977.htmlhttp://www.shnenglu.com/Icho/archive/2010/08/19/123977.html#Feedback0http://www.shnenglu.com/Icho/comments/commentRss/123977.htmlhttp://www.shnenglu.com/Icho/services/trackbacks/123977.html杈撳叆鍖呭惈K涓祴璇曟牱渚嬨傝緭鍏ョ涓琛屼細(xì)緇欏嚭 K (1<=K<=5)銆傛瘡涓祴璇曟牱渚嬪崰涓琛屻傝繖涓琛岀殑絎竴涓暟鏄竴涓鏁存暟N (N<=1000)銆?鎺ョ潃鏄疦涓潪璐熸暣鏁?(搴忓垪 A)銆?鍧囦笉瓚呰繃109銆?/p> 鏁版牴(鐧懼害鐭ラ亾): http://zhidao.baidu.com/question/29789035.html
瀵逛簬姹備綑鏁扮殑闂鏄垜涓寮濮嬪氨蹇界暐浜?jiǎn)鐨勫湴鏂瑰Q屽悗鏉ョ湅浜?jiǎn)HPF鐨勫崥瀹紝鎵嶇煡閬撴湁榪欐牱鐨勬妧宸?
   (A+B)mod C = (A mod C) + (B mod C)
   (AB) mod C = (A mod C) × (B mod C)

C緙栬瘧鍣?, 0MS  0KB , 濡傛灉浣犳妸鍓嶄袱鍙ュ畾涔夊彉閲忕殑璇彞瀵硅皟錛屽皢浼?xì)鑰楄垂 20MS 鐨勬椂闂?br>
#include <stdio.h>
int main() 
{
    
int i=0,j,K,N,temp,m;
    
long int A;
    scanf(
"%d",&K);
    
for (; i<K; i++) {
        scanf(
"%d",&N);
        m
=1;
        A
=0;
        
for (j=0; j<N; j++) {
            scanf(
"%d",&temp);
            temp
%=9;
            m
=(m*temp)%9;
            A
=(A+m)%9;
        }
        printf(
"%d\n",(A+8)%9+1);
    }
    
return 0;
}


Brian 2010-08-19 15:35 鍙戣〃璇勮
]]>
SGU 111 Very simple problemhttp://www.shnenglu.com/Icho/archive/2010/08/19/123969.htmlBrianBrianThu, 19 Aug 2010 06:36:00 GMThttp://www.shnenglu.com/Icho/archive/2010/08/19/123969.htmlhttp://www.shnenglu.com/Icho/comments/123969.htmlhttp://www.shnenglu.com/Icho/archive/2010/08/19/123969.html#Feedback3http://www.shnenglu.com/Icho/comments/commentRss/123969.htmlhttp://www.shnenglu.com/Icho/services/trackbacks/123969.html甯屾湜澶х墰浠寚鏁?/span>錛?br>
#include <iostream>
#include 
<stdio.h>
using namespace std;

int main()
{
    __int64 x,left,right,mid;
    scanf(
"%I64d",&x); 
    left
=0;
    right
=x+1;
    
while ((left+1)<right) // 浜屽垎鏌ユ壘
    {
        mid
=(left+right)/2;
        
if(mid*mid<=x)
          left
=mid;
        
else
          right
=mid;
    }
    printf(
"%I64d",left);
    
return 0;
}


Brian 2010-08-19 14:36 鍙戣〃璇勮
]]>
鏈褰㈣薄鐨勫揩鎺?/title><link>http://www.shnenglu.com/Icho/archive/2010/08/19/123901.html</link><dc:creator>Brian</dc:creator><author>Brian</author><pubDate>Wed, 18 Aug 2010 16:23:00 GMT</pubDate><guid>http://www.shnenglu.com/Icho/archive/2010/08/19/123901.html</guid><wfw:comment>http://www.shnenglu.com/Icho/comments/123901.html</wfw:comment><comments>http://www.shnenglu.com/Icho/archive/2010/08/19/123901.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Icho/comments/commentRss/123901.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Icho/services/trackbacks/123901.html</trackback:ping><description><![CDATA[<img style="WIDTH: 449px; HEIGHT: 345px" border=0 alt="" src="http://www.shnenglu.com/images/cppblog_com/icho/quicksort.gif" width=449 height=345> <img src ="http://www.shnenglu.com/Icho/aggbug/123901.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Icho/" target="_blank">Brian</a> 2010-08-19 00:23 <a href="http://www.shnenglu.com/Icho/archive/2010/08/19/123901.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ 1046 Color Me Lesshttp://www.shnenglu.com/Icho/archive/2010/08/18/123773.htmlBrianBrianTue, 17 Aug 2010 17:00:00 GMThttp://www.shnenglu.com/Icho/archive/2010/08/18/123773.htmlhttp://www.shnenglu.com/Icho/comments/123773.htmlhttp://www.shnenglu.com/Icho/archive/2010/08/18/123773.html#Feedback0http://www.shnenglu.com/Icho/comments/commentRss/123773.htmlhttp://www.shnenglu.com/Icho/services/trackbacks/123773.html
棰樼洰鐨勮姹傛槸杈撳叆鑻ュ共緇勯鑹叉暟鎹紝鍓?6緇勬槸鐩爣緇勶紝鍚庨潰鍓╀笅鐨勯兘鏄敤鏉ュ皾璇曚笌鍏舵槧灝勭殑錛岀敤鍚庨潰涓庡墠闈㈢殑涓嬈″尮閰嶏紝鍚勫驚鐜?6嬈★紝鍚勮嚜鏈灝忕殑D鐨勭浉搴旀槧灝勭粍灝辨槸鎴戜滑瑕佺殑緇撴灉銆?br>
C++ 緙栬瘧鍣?錛?20K  0MS
#include<iostream>
#include
<climits> // 涓虹涓緇勬暟鎹繍綆楀仛鐨勭害鏉?/span>
using namespace std;  
int RGB[16][3],in[3],out[3]; // in 鐢ㄦ潵鎺ユ敹鏁版嵁, out 鐢ㄦ潵鏆傚瓨鏄犲皠姝g‘鐨勬暟鎹?/span>

int main(){ 
    
for (int i=0; i<16; i++// 杈撳叆鐨勬暟鎹腑鍓?6緇勬槸 target set
        cin>>RGB[i][0]>>RGB[i][1]>>RGB[i][2]; 
    
while (1) { 
        cin
>>in[0]>>in[1]>>in[2]; // 寮濮嬫帴鏀舵槧灝勭粍
        if (in[0== -1break;
        
int MIN=INT_MAX; // 2147483647
        for (int i=0; i<16; i++) { 
            
int sum=(RGB[i][0]-in[0])*(RGB[i][0]-in[0])+
                (RGB[i][
1]-in[1])*(RGB[i][1]-in[1])+
                (RGB[i][
2]-in[2])*(RGB[i][2]-in[2]); // 涓嶉渶瑕佸紑鏂癸紝寮鏂規(guī)槗浜х敓璇樊
            if (sum < MIN) { 
                
out[0]=RGB[i][0]; 
                
out[1]=RGB[i][1]; 
                
out[2]=RGB[i][2]; 
                MIN
=sum; // 鏈灝忕殑鍗蟲槧灝勬垚鍔?/span>
            } 
        } 
        cout
<<"("<<in[0]<<","<<in[1]<<","<<in[2]<<") maps to ("
            
<<out[0]<<","<<out[1]<<","<<out[2]<<")"<<endl;  
    }
    
return 0;
}

鏈変竴鐐硅璇存槑鐨勬槸<limits.h>澶存枃浠訛紝寤鴻MSDN涓涓嬶紝浣犱細(xì)鍙戠幇寰堝鏈夌敤鐨勫父閲忥紝鎷挎潵灝辮兘鐢ㄣ?

Brian 2010-08-18 01:00 鍙戣〃璇勮
]]>
POJ 1045 Bode Plothttp://www.shnenglu.com/Icho/archive/2010/08/17/123728.htmlBrianBrianTue, 17 Aug 2010 06:49:00 GMThttp://www.shnenglu.com/Icho/archive/2010/08/17/123728.htmlhttp://www.shnenglu.com/Icho/comments/123728.htmlhttp://www.shnenglu.com/Icho/archive/2010/08/17/123728.html#Feedback0http://www.shnenglu.com/Icho/comments/commentRss/123728.htmlhttp://www.shnenglu.com/Icho/services/trackbacks/123728.html鎴戣寰楁湁蹇呰鎶婂畠緲昏瘧涓涓嬶紝鐒跺悗灝變細(xì)鍙戠幇鑰冨緱鍏跺疄鏄暟瀛︼紝浣犲湪google 緲昏瘧涓婃槸寰椾笉鍒板涓嬬炕璇戠殑錛?br>Description
鑰冭檻涓嬮潰鐨勪氦嫻佺數(shù)璺傛垜浠皢鍋囧畾鐢?shù)璧\鍦ㄧǔ鎬併傚洜姝わ紝鑺傜偣1鐨勭數(shù)鍘嬪拰鑺傜偣2鐨勭數(shù)鍘嬪垎鍒槸v1 = VS coswt 鍜?v2 = VRcos (wt + q),鍏朵腑Vs鏄數(shù)婧愮數(shù)鍘嬶紝w鏄鐜?寮у害姣忕)錛宼鏄椂闂淬俈R鏄數(shù)闃籖涓ょ鐢?shù)鍘嬩笅闄嶇殑骞呭害锛宷鏄畠鐨勭浉浣嶃?br>POJ 1045 Bode Plot - Icho - Brian Warehouse
浣犻渶瑕佸啓涓涓▼搴忥紝浠ョ‘瀹氫笉鍚岀殑w瀵瑰簲鐨刅R鍊箋傛?zhèn)畣闇瑕佷袱涓數(shù)瀛﹀畾寰嬫潵瑙e喅榪欎釜闂銆傜涓
涓槸鏄濮嗗畾寰嬶紝琛ㄨ堪涓篤2 = iR錛屽叾涓璱鏄湪鐢?shù)璧\欏烘椂閽堟祦鍚戠殑鐢墊祦澶у皬銆?br>絎簩涓槸i = C d/dt (v1-v2)錛宨涓庣數(shù)瀹瑰櫒涓ゆ澘涓婄殑鐢?shù)鍘嬫湁鍏炽?d/dt" 鎰忎負(fù)姹傚叧浜巘鐨勬眰瀵箋?br>Input
杈撳叆鍖呮嫭涓琛屾垨澶氳銆傜涓琛屽寘鎷笁涓疄鏁板拰涓涓潪璐熸暣鏁般傚疄鏁版寜欏哄簭鏄疺S錛孯錛孋銆?br>鏁存暟n鏄祴璇曠敤渚嬬殑涓暟銆傛帴涓嬫潵鐨刵琛屽氨鏄緭鍏ワ紝瑕佹眰涓琛屼竴涓疄鏁幫紝浠h〃w鐨勫箋?/p>

Output
杈撳嚭n琛岀殑VR鍊鹼紝娉ㄦ剰錛岀粨鏋滅簿紜埌灝忔暟鐐瑰悗涓変綅銆?br>涓嬮潰闇瑕佹帹瀵間竴涓嬫眰VR鐨勫叕寮忥細(xì)
V2=iR=CR d/dt (VS*cos(wt)-VR*cos(wt+q))=VRcos(wt+q)
         = CR w (sin(wt+q)-sin(wt))=VRcos(wt+q)
涓嬮潰鐢ㄥ埌楂樹腑鏁板褰撲腑鐨勮綆楁柟娉曪紝鍒嗗埆浠?t=0 鍜?wt+q=0 錛屽緱鍒?CRw  tan b = 1 鍜?VR=CRw VS sin b 錛?/font>
鐒跺悗鍒╃敤涓夎鍑芥暟涓殑涓囪兘鍏紡錛屾眰寰?錛?font color=#ff0000>VR = CRw VS / sqrt (1+ (CRw) ^ 2 ))

POJ 1045 Bode Plot - Icho - Brian Warehouse// C 緙栬瘧鍣?
POJ 1045 Bode Plot - Icho - Brian Warehouse
#include <stdio.h>
POJ 1045 Bode Plot - Icho - Brian Warehouse#include 
<math.h>
POJ 1045 Bode Plot - Icho - Brian Warehouse
int main()
POJ 1045 Bode Plot - Icho - Brian WarehousePOJ 1045 Bode Plot - Icho - Brian Warehouse
POJ 1045 Bode Plot - Icho - Brian Warehouse{
POJ 1045 Bode Plot - Icho - Brian Warehouse    
int i=0,n;
POJ 1045 Bode Plot - Icho - Brian Warehouse    
double VR,VS,R,C,w;
POJ 1045 Bode Plot - Icho - Brian Warehouse    scanf(
"%lf%lf%lf%d",&VS,&R,&C,&n);    
POJ 1045 Bode Plot - Icho - Brian Warehouse    
POJ 1045 Bode Plot - Icho - Brian Warehouse    
for (; i<n; i++)
POJ 1045 Bode Plot - Icho - Brian WarehousePOJ 1045 Bode Plot - Icho - Brian Warehouse    
POJ 1045 Bode Plot - Icho - Brian Warehouse{
POJ 1045 Bode Plot - Icho - Brian Warehouse        scanf(
"%lf",&w);
POJ 1045 Bode Plot - Icho - Brian Warehouse        VR
=C*R*w*VS / sqrt(1+C*C*R*R*w*w);
POJ 1045 Bode Plot - Icho - Brian Warehouse        printf(
"%.3lf\n",VR);
POJ 1045 Bode Plot - Icho - Brian Warehouse    }

POJ 1045 Bode Plot - Icho - Brian Warehouse    
return 0;
POJ 1045 Bode Plot - Icho - Brian Warehouse}

娉ㄦ剰 , 鐢?double 

Brian 2010-08-17 14:49 鍙戣〃璇勮
]]>
澶ф暟闂瀛︿範(fàn)鍛?2)錛歅OJ Grids 2980 澶ф暣鏁頒箻娉?/title><link>http://www.shnenglu.com/Icho/archive/2010/08/17/123726.html</link><dc:creator>Brian</dc:creator><author>Brian</author><pubDate>Tue, 17 Aug 2010 06:24:00 GMT</pubDate><guid>http://www.shnenglu.com/Icho/archive/2010/08/17/123726.html</guid><wfw:comment>http://www.shnenglu.com/Icho/comments/123726.html</wfw:comment><comments>http://www.shnenglu.com/Icho/archive/2010/08/17/123726.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Icho/comments/commentRss/123726.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Icho/services/trackbacks/123726.html</trackback:ping><description><![CDATA[<span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a[</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">],b[</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">],c[</span><span style="COLOR: #000000">400</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">},i,j,ls1,ls2;<br>    </span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000"> s;<br>    <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">s,ls1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s.length(),i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ls1</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        a[j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝嗙涓涓暟閫嗗簭鏀懼叆a鏁扮粍</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">s,ls2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s.length(),i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ls2</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        b[j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝嗙浜屼釜鏁伴嗗簭鏀懼叆b鏁扮粍</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">ls1; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">ls2; j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            c[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">j] </span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000"> a[i]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">b[j];<br>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(c[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">j] </span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">)<br>            {<br>                c[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">j</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">] </span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000"> c[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">j]</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">;<br>                c[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">j] </span><span style="COLOR: #000000">%=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">;<br>            }<br>        }<br>    <br>    i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">399</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000"> (i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (c[i]) </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">璺寵繃鎵鏈夊墠瀵?</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,c[i]); </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">杈撳嚭涓諱綋閮ㄥ垎</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}<br></span> <img src ="http://www.shnenglu.com/Icho/aggbug/123726.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Icho/" target="_blank">Brian</a> 2010-08-17 14:24 <a href="http://www.shnenglu.com/Icho/archive/2010/08/17/123726.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>澶ф暟闂瀛︿範(fàn)鍛?1)錛歅OJ Grids 2981 澶ф暣鏁板姞娉?/title><link>http://www.shnenglu.com/Icho/archive/2010/08/17/123725.html</link><dc:creator>Brian</dc:creator><author>Brian</author><pubDate>Tue, 17 Aug 2010 06:21:00 GMT</pubDate><guid>http://www.shnenglu.com/Icho/archive/2010/08/17/123725.html</guid><wfw:comment>http://www.shnenglu.com/Icho/comments/123725.html</wfw:comment><comments>http://www.shnenglu.com/Icho/archive/2010/08/17/123725.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Icho/comments/commentRss/123725.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Icho/services/trackbacks/123725.html</trackback:ping><description><![CDATA[<div style="BORDER-BOTTOM: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; PADDING-BOTTOM: 4px; BACKGROUND-COLOR: #eeeeee; PADDING-LEFT: 4px; WIDTH: 98%; PADDING-RIGHT: 5px; FONT-SIZE: 12pt; WORD-BREAK: break-all; BORDER-TOP: #cccccc 1px solid; BORDER-RIGHT: #cccccc 1px solid; PADDING-TOP: 4px"><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a[</span><span style="COLOR: #000000">201</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">},b[</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">},i,j,len,ls1,ls2,f</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 鐩稿姞鍚庣粨鏋滄斁鍦╝鍐?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000"> s;<br>    <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">s,ls1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s.length(),i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ls1</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        a[j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝嗙涓涓暟閫嗗簭鏀懼叆a鏁扮粍</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">s,ls2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s.length(),i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ls2</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        b[j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝嗙浜屼釜鏁伴嗗簭鏀懼叆b鏁扮粍</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000"><br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,len</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ls1</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">ls2</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">ls1:ls2; i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">) </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 娉ㄦ剰len鍙栦簩鑰呰緝澶х殑鍊?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    {<br>        a[i] </span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000"> b[i]; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鐩稿姞緇撴灉鏀懼叆a鏁扮粍</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (a[i] </span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">)<br>        {<br>            a[i] </span><span style="COLOR: #000000">%=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">榪涗綅澶勭悊</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">            a[i</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br>        }<br>    }<br>    <br>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (a[len]) printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,a[len]); </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎵璋撶殑鍓嶅0</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">len</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">>=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,a[i]); </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">杈撳嚭涓諱綋閮ㄥ垎</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <img src ="http://www.shnenglu.com/Icho/aggbug/123725.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Icho/" target="_blank">Brian</a> 2010-08-17 14:21 <a href="http://www.shnenglu.com/Icho/archive/2010/08/17/123725.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ-grids 2808 鏍¢棬澶栫殑鏍?/title><link>http://www.shnenglu.com/Icho/archive/2010/08/17/123724.html</link><dc:creator>Brian</dc:creator><author>Brian</author><pubDate>Tue, 17 Aug 2010 06:19:00 GMT</pubDate><guid>http://www.shnenglu.com/Icho/archive/2010/08/17/123724.html</guid><wfw:comment>http://www.shnenglu.com/Icho/comments/123724.html</wfw:comment><comments>http://www.shnenglu.com/Icho/archive/2010/08/17/123724.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Icho/comments/commentRss/123724.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Icho/services/trackbacks/123724.html</trackback:ping><description><![CDATA[<dl> <dt>棰樼洰鎻忚堪 <dd>鏌愭牎澶ч棬澶栭暱搴︿負(fù)L鐨勯┈璺笂鏈変竴鎺掓爲(wèi)錛屾瘡涓ゆ5鐩擱偦鐨勬爲(wèi)涔嬮棿鐨勯棿闅旈兘鏄?綾熾傛垜浠彲浠ユ妸椹礬鐪嬫垚涓涓暟杞達(dá)紝椹礬鐨勪竴绔湪鏁拌醬0鐨勪綅緗紝鍙︿竴绔湪L鐨勪綅緗紱鏁拌醬涓婄殑姣忎釜鏁存暟鐐癸紝鍗?錛?錛?錛?#8230;…錛孡錛岄兘縐嶆湁涓媯墊爲(wèi)銆?br>椹礬涓婃湁涓浜涘尯鍩熻鐢ㄦ潵寤哄湴閾侊紝榪欎簺鍖哄煙鐢ㄥ畠浠湪鏁拌醬涓婄殑璧峰鐐瑰拰緇堟鐐硅〃紺恒傚凡鐭ヤ換涓鍖哄煙鐨勮搗濮嬬偣鍜岀粓姝㈢偣鐨勫潗鏍囬兘鏄暣鏁幫紝鍖哄煙涔嬮棿鍙兘鏈夐噸鍚堢殑閮ㄥ垎銆傜幇鍦ㄨ鎶婅繖浜涘尯鍩熶腑鐨勬爲(wèi)錛堝寘鎷尯鍩熺鐐瑰鐨勪袱媯墊爲(wèi)錛夌Щ璧般備綘鐨勪換鍔℃槸璁$畻灝嗚繖浜涙爲(wèi)閮界Щ璧板悗錛岄┈璺笂榪樻湁澶氬皯媯墊爲(wèi)銆?br> <dt>杈撳叆 <dd>杈撳叆鐨勭涓琛屾湁涓や釜鏁存暟L錛? <= L <= 10000錛夊拰 M錛? <= M <= 100錛夛紝L浠h〃椹礬鐨勯暱搴︼紝M浠h〃鍖哄煙鐨勬暟鐩紝L鍜孧涔嬮棿鐢ㄤ竴涓┖鏍奸殧寮銆傛帴涓嬫潵鐨凪琛屾瘡琛屽寘鍚袱涓笉鍚岀殑鏁存暟錛岀敤涓涓┖鏍奸殧寮錛岃〃紺轟竴涓尯鍩熺殑璧峰鐐瑰拰緇堟鐐圭殑鍧愭爣銆? <dt>杈撳嚭 <dd>杈撳嚭鍖呮嫭涓琛岋紝榪欎竴琛屽彧鍖呭惈涓涓暣鏁幫紝琛ㄧず椹礬涓婂墿浣欑殑鏍?wèi)鐨勬暟鐩? <dt>鏍蜂緥杈撳叆 <dd> <pre>500 3 150 300 100 200 470 471 </pre> <dt>鏍蜂緥杈撳嚭 <dd> <pre>298</pre> </dd></dl> <pre>鍩烘湰鎬濊礬錛氬皢鎵鏈夌殑鏍?wèi)鍋氭爣璁板Q岀Щ璧板垯鏍囪涓?錛屽瓨鍦ㄦ爣璁頒負(fù)1.鐢變簬涓嶅ソ鍒ゆ柇緇欏畾鏁扮洰鏄灝戯紝鏁呯敤鍚戦噺銆傛晥鐜囪櫧鐒朵笉楂橈紝浣嗘槸鍙互AC銆?/pre> <pre> <div style="BORDER-BOTTOM: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; PADDING-BOTTOM: 4px; BACKGROUND-COLOR: #eeeeee; PADDING-LEFT: 4px; WIDTH: 98%; PADDING-RIGHT: 5px; FONT-SIZE: 12pt; WORD-BREAK: break-all; BORDER-TOP: #cccccc 1px solid; BORDER-RIGHT: #cccccc 1px solid; PADDING-TOP: 4px"><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">vector</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> L,M,i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,j,start,end,count</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">L,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">M);<br>    vector</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> Mark(L</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br>    <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (; i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">M; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">) <br>    {<br>        scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">start,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">end);<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">start; j</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">end; j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            Mark[j]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    }<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">L; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (Mark[i]</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br>            count</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,count);<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> </pre> <pre> </pre> <img src ="http://www.shnenglu.com/Icho/aggbug/123724.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Icho/" target="_blank">Brian</a> 2010-08-17 14:19 <a href="http://www.shnenglu.com/Icho/archive/2010/08/17/123724.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ Grids 2798 2榪涘埗杞寲涓?6榪涘埗http://www.shnenglu.com/Icho/archive/2010/08/17/123723.htmlBrianBrianTue, 17 Aug 2010 06:18:00 GMThttp://www.shnenglu.com/Icho/archive/2010/08/17/123723.htmlhttp://www.shnenglu.com/Icho/comments/123723.htmlhttp://www.shnenglu.com/Icho/archive/2010/08/17/123723.html#Feedback0http://www.shnenglu.com/Icho/comments/commentRss/123723.htmlhttp://www.shnenglu.com/Icho/services/trackbacks/123723.htmlDescription

杈撳叆涓涓?榪涘埗鐨勬暟錛岃姹傝緭鍑?guó)櫙?榪涘埗鏁扮殑16榪涘埗琛ㄧず銆?
鍦?6榪涘埗鐨勮〃紺轟腑錛孉-F琛ㄧず10-15

Input

絎?琛屾槸嫻嬭瘯鏁版嵁鐨勭粍鏁皀錛屽悗闈㈣窡鐫n琛岃緭鍏ャ傛瘡緇勬祴璇曟暟鎹崰1琛岋紝鍖呮嫭涓涓互0鍜?緇勬垚鐨勫瓧絎︿覆錛屽瓧絎︿覆闀垮害鑷沖皯鏄?錛岃嚦澶氭槸10000

Output

n琛岋紝姣忚杈撳嚭瀵瑰簲涓涓緭鍏ャ?/font>

Sample Input

2
100000
111

 

 

 

Sample Output

20
7


09灝忓闂垜鐨勪竴閬撻錛屽師鏉ュ啓鐨勪唬鐮佽凍瓚蟲湁90澶氳錛屼粖澶╅噸鍐欙細(xì)
 
#include <iostream>
#include 
<string>
using namespace std;

int main()
{
    
int n,pos,sec,i,j,w[4= {1,2,4,8}; //sec鏄垎孌靛鐞?pos鏄搴旀潈鍊間綅緗?/span>
    char x[17= "0123456789ABCDEF"//鎵撹〃        
    string bin; //杈撳叆鐨勪簩榪涘埗瀛楃涓?/span>
    cin>>n;
    
while (n--)
    {
        cin
>>bin;
        sec
=bin.length()%4;
        pos
=0;
        
for (i=sec; i>0; i--)
            
if (bin[sec-i]=='1')
                pos 
+= w[i-1];
        
if (sec) printf("%c",x[pos]);
        
for (i=sec; i<bin.length(); i+=4)
        {
            pos
=0;
            
for (j=0; j<4; j++)
                
if (bin[i+j]=='1')
                    pos 
+= w[3-j];
            printf(
"%c",x[pos]);
        }
        printf(
"\n");
    }
    
return 0;
}


Brian 2010-08-17 14:18 鍙戣〃璇勮
]]>
POJ Grids 2745 鏄劇ず鍣?/title><link>http://www.shnenglu.com/Icho/archive/2010/08/17/123722.html</link><dc:creator>Brian</dc:creator><author>Brian</author><pubDate>Tue, 17 Aug 2010 06:17:00 GMT</pubDate><guid>http://www.shnenglu.com/Icho/archive/2010/08/17/123722.html</guid><wfw:comment>http://www.shnenglu.com/Icho/comments/123722.html</wfw:comment><comments>http://www.shnenglu.com/Icho/archive/2010/08/17/123722.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Icho/comments/commentRss/123722.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Icho/services/trackbacks/123722.html</trackback:ping><description><![CDATA[<p align=left><strong><font color=#333399 size=5>Description</font> </strong></p> <p><font size=3 face="Times New Roman">浣犵殑涓涓湅鍙嬩拱浜?jiǎn)涓鍙扮數(shù)鑴戙備粬浠ュ墠鍙敤榪囪綆楀櫒錛屽洜涓虹數(shù)鑴戠殑鏄劇ず鍣ㄤ笂鏄劇ず鐨勬暟瀛楃殑鏍峰瓙鍜岃綆楀櫒鏄笉涓鏍鳳紝鎵浠ュ綋浠栦嬌鐢ㄧ數(shù)鑴戠殑鏃跺欎細(xì)姣旇緝閮侀椃銆備負(fù)浜?jiǎn)甯姪浠栧Q屼綘鍐沖畾鍐欎竴涓▼搴忔妸鍦ㄧ數(shù)鑴戜笂鐨勬暟瀛楁樉紺哄緱鍍忚綆楀櫒涓婁竴鏍楓?/font></p> <p align=left><strong><font color=#333399 size=5>Input</font> </strong></p> <p><font size=3 face="Times New Roman">杈撳叆鍖呮嫭鑻ュ共琛岋紝姣忚琛ㄧず涓涓鏄劇ず鐨勬暟銆傛瘡琛屾湁涓や釜鏁存暟s鍜宯 (1 <= s <= 10, 0 <= n <= 99999999)錛岃繖閲宯鏄鏄劇ず鐨勬暟錛宻鏄鏄劇ず鐨勬暟鐨勫昂瀵搞?<br><br>濡傛灉鏌愯杈撳叆鍖呮嫭涓や釜0錛岃〃紺鴻緭鍏ョ粨鏉熴傝繖琛屼笉闇瑕佸鐞嗐?<br></font></p> <p align=left><strong><font color=#333399 size=5>Output</font> </strong></p> <p><font size=3 face="Times New Roman">鏄劇ず鐨勬柟寮忔槸錛氱敤s涓?-'琛ㄧず涓涓按騫崇嚎孌碉紝鐢╯涓?|'琛ㄧず涓涓瀭鐩寸嚎孌點(diǎn)傝繖縐嶆儏鍐典笅錛屾瘡涓涓暟瀛楅渶瑕佸崰鐢╯+2鍒楀拰2s+3琛屻傚彟澶栵紝鍦ㄤ袱涓暟瀛椾箣闂磋杈撳嚭涓涓┖鐧界殑鍒椼傚湪杈撳嚭瀹屾瘡涓涓暟涔嬪悗錛岃緭鍑轟竴涓┖鐧界殑琛屻傛敞鎰忥細(xì)杈撳嚭涓┖鐧界殑鍦版柟閮借鐢ㄧ┖鏍兼潵濉厖銆?<br></font></p> <p align=left><strong><font color=#333399 size=5>Sample Input</font> </strong></p> <p><font size=3 face="Times New Roman"></p> <pre>2 12345 3 67890 0 0 </pre> </font> <p> </p> <p> </p> <p align=left><strong><font color=#333399 size=5>Sample Output</font> </strong></p> <p><font size=3 face="Times New Roman"></p> <pre> -- -- -- | | | | | | | | | | | | -- -- -- -- | | | | | | | | | | -- -- -- --- --- --- --- --- | | | | | | | | | | | | | | | | | | | | | | | | --- --- --- | | | | | | | | | | | | | | | | | | | | | | | | --- --- --- --- </pre> </font> <p> </p> <p> </p> <p align=left><strong><font color=#333399 size=5>Hint</font> </strong></p> <p><font size=3 face="Times New Roman">鏁板瓧(digit)鎸囩殑鏄?錛屾垨鑰?錛屾垨鑰?……鎴栬?銆?<br>鏁?number)鐢變竴涓垨鑰呭涓暟瀛楃粍鎴愩?</font></p> <p style="TEXT-INDENT: 2em">榪欓妯法鎴戜竴涓鏈熶箣涔咃紝鍚庢潵鏃犲榪樻槸鐧懼害浜?jiǎn)涓涓嬶細(xì)</p> <div style="BORDER-BOTTOM: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; PADDING-BOTTOM: 4px; BACKGROUND-COLOR: #eeeeee; PADDING-LEFT: 4px; WIDTH: 98%; PADDING-RIGHT: 5px; FONT-SIZE: 12pt; WORD-BREAK: break-all; BORDER-TOP: #cccccc 1px solid; BORDER-RIGHT: #cccccc 1px solid; PADDING-TOP: 4px"><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n1[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">- -- -----</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n2[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">|   ||| ||</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n3[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">|||||  |||</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n4[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">  ----- --</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n5[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">| |   | | </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n6[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">|| |||||||</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n7[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">- -- -- --</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> m;<br>    </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> n[</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">];<br>    cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">m</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">n;<br>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000"> ((n[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">m)<br>    {<br>        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> len </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> strlen(n);<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> n[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n1[num];<br>            }<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>        }<br>        cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br>        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> temp </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> m;<br>        </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000"> (temp</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        {<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> n[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n2[num];<br>                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>                {<br>                    cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>                }<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n3[num];<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>            }<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br>        }<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> n[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n4[num];<br>            }<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>        }<br>        cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br>        temp </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> m;<br>        </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000"> (temp</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)<br>        {<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> n[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n5[num];<br>                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>                {<br>                    cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>                }<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n6[num];<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>            }<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br>        }<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> n[i]</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">n7[num];<br>            }<br>            cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>        }<br>        cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br><br>        cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">m</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">n;<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}<br></span></div> <p> </p> <p>鎴戞兂錛岀涓嬈″仛鍑烘潵榪欓鐨勪漢鐪熸槸浜?jiǎn)涓嶈跌P紒</p> <img src ="http://www.shnenglu.com/Icho/aggbug/123722.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Icho/" target="_blank">Brian</a> 2010-08-17 14:17 <a href="http://www.shnenglu.com/Icho/archive/2010/08/17/123722.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.safaen.cn" target="_blank">亚洲国产成人久久一区久久</a>| <a href="http://www.elecline.com.cn" target="_blank">久久亚洲熟女cc98cm</a>| <a href="http://www.z1359.cn" target="_blank">国内精品久久久久影院日本</a>| <a href="http://www.yangrendong.com.cn" target="_blank">伊人色综合久久天天网 </a>| <a href="http://www.tianyicpa.com.cn" target="_blank">中文字幕精品久久久久人妻</a>| <a href="http://www.kmqqk.cn" target="_blank">久久青青草原国产精品免费</a>| <a href="http://www.fddyc.cn" target="_blank">97久久超碰国产精品2021</a>| <a href="http://www.jiangyuyun.cn" target="_blank">中文字幕乱码人妻无码久久</a>| <a href="http://www.infotme.com.cn" target="_blank">久久99热这里只有精品国产</a>| <a href="http://www.qdyshl.cn" target="_blank">久久久久国产精品人妻</a>| <a href="http://www.qhsy217.cn" target="_blank">久久久久波多野结衣高潮</a>| <a href="http://www.jkzyzj.cn" target="_blank">精品综合久久久久久98</a>| <a href="http://www.uzijav.cn" target="_blank">久久丫忘忧草产品</a>| <a href="http://www.16315.com.cn" target="_blank">久久精品久久久久观看99水蜜桃</a>| <a href="http://www.syworld.com.cn" target="_blank">三级三级久久三级久久</a>| <a href="http://www.093156.net.cn" target="_blank">18禁黄久久久AAA片</a>| <a href="http://www.bbs0310.cn" target="_blank">久久精品日日躁夜夜躁欧美</a>| <a href="http://www.yixue77.cn" target="_blank">色欲综合久久中文字幕网</a>| <a href="http://www.gzmxjc.cn" target="_blank">麻豆一区二区99久久久久</a>| <a href="http://www.qianhongg.cn" target="_blank">激情伊人五月天久久综合</a>| <a href="http://www.suntiepu.cn" target="_blank">久久精品国产半推半就</a>| <a href="http://www.kou365.cn" target="_blank">国产午夜精品理论片久久</a>| <a href="http://www.paypaal.cn" target="_blank">久久精品夜色噜噜亚洲A∨</a>| <a href="http://www.best35.cn" target="_blank">久久人人爽人人爽人人片AV东京热 </a>| <a href="http://www.lubricantbrand.cn" target="_blank">国产一久久香蕉国产线看观看</a>| <a href="http://www.zhangmengm.cn" target="_blank">7777久久亚洲中文字幕</a>| <a href="http://www.gdkm2.cn" target="_blank">国产亚洲精久久久久久无码AV</a>| <a href="http://www.botouvr.cn" target="_blank">天天影视色香欲综合久久</a>| <a href="http://www.pingyaonews.cn" target="_blank">欧美一区二区久久精品</a>| <a href="http://www.meng1.cn" target="_blank">久久这里只有精品18</a>| <a href="http://www.globalimports.cn" target="_blank">国产精品久久久久久久久免费</a>| <a href="http://www.cnmncom.cn" target="_blank">精品久久久久久无码人妻热 </a>| <a href="http://www.fhbp.net.cn" target="_blank">超级碰碰碰碰97久久久久</a>| <a href="http://www.qcqxzx.cn" target="_blank">综合网日日天干夜夜久久</a>| <a href="http://www.ffcchh.com.cn" target="_blank">国产91色综合久久免费</a>| <a href="http://www.hanshigu.cn" target="_blank">久久久久黑人强伦姧人妻</a>| <a href="http://www.fyjzhxf.cn" target="_blank">久久精品国产色蜜蜜麻豆</a>| <a href="http://www.xinhuahz.cn" target="_blank">国产亚洲美女精品久久久久狼</a>| <a href="http://www.wanghaochuju.cn" target="_blank">国产精品一区二区久久精品无码 </a>| <a href="http://www.dgjiajun.net.cn" target="_blank">精品多毛少妇人妻AV免费久久 </a>| <a href="http://www.imlee.com.cn" target="_blank">久久久99精品成人片中文字幕</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>