锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品女人天堂AV麻,精品无码久久久久国产动漫3d,久久久久无码专区亚洲avhttp://www.shnenglu.com/shexinwei/緙栧啓浜虹敓鐨勪唬鐮?/description>zh-cnTue, 06 May 2025 22:39:41 GMTTue, 06 May 2025 22:39:41 GMT60瀛楃涓插垹闄ゅ瓙涓?C++)http://www.shnenglu.com/shexinwei/archive/2010/10/06/128812.html椹禌鍏?07椹禌鍏?07Wed, 06 Oct 2010 12:45:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/10/06/128812.htmlhttp://www.shnenglu.com/shexinwei/comments/128812.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/10/06/128812.html#Feedback0http://www.shnenglu.com/shexinwei/comments/commentRss/128812.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/128812.html#include <iostream>
using namespace std;

int main()
{
    
char str[50= {0};
    
char subStr[10= {0};

    
//杈撳叆涓諱覆浠?緇撳熬
    cout<<"input the string:";
    
for(int i = 0;i<sizeof(str)/sizeof(str[0]);i++)
    {
        cin
>>str[i];
        
if(str[i] == '#')
        {
            str[i] 
= '\0';
            
break;
        }
    }

    
//杈撳叆瀛愪覆浠?緇撳熬
    cout<<"input the substring:";
    
for(int i = 0;i<sizeof(subStr)/sizeof(subStr[0]);i++)
    {
      cin
>>subStr[i];
      
if(subStr[i] == '#')
      {
          subStr[i] 
= '\0';
          
break;
      }
    }

    
//鐢ㄤ簬鏍囪鏄惁鎵懼埌瀛愪覆
    bool isSub = true;

    
//鎵懼瓙涓?/span>
    for(int i = 0;i<strlen(str);i++)
    {
        isSub 
= true;
        
for(int j = 0;j<strlen(subStr);j++)
        {
            
if(subStr[j] == str[i+j]) continue;
            
else 
            {
                isSub 
= false;
                
break;
            }

        }
        
        
if(isSub)
        {
//濡傛灉鎵懼埌瀛愪覆錛屽垯灝嗗悗緇瓧絎﹀叏閮ㄥ墠縐?/span>
         for(int m = i;m<strlen(str)+1-strlen(subStr);m++)
         {
             str[m] 
= str[m+strlen(subStr)];
         }
        }
    }

    
//杈撳嚭鍒犻櫎鍚庣殑
    cout<<"the result string:"<<str<<endl;
    system(
"pause");
    
return 1;
}


]]>
鍐掓場鎺掑簭(C++)http://www.shnenglu.com/shexinwei/archive/2010/09/28/127992.html椹禌鍏?07椹禌鍏?07Tue, 28 Sep 2010 13:46:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/28/127992.htmlhttp://www.shnenglu.com/shexinwei/comments/127992.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/28/127992.html#Feedback0http://www.shnenglu.com/shexinwei/comments/commentRss/127992.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/127992.html/*
Subject:      Bubble sort
Author:       shexinwei
Date:         2010-09-28
Laguage:      C++
IDE | Tool:   GCC(DEV 5.0)
Version:      1.0
Modify Time:  2010-09-28
*/   

#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
//鎺掑簭鍑芥暟
int Bublle_sort(int data[],int n);
//鎵撳嵃鏁扮粍鍑芥暟
int print(int data[],int n);
int main(int argc, char *argv[])
{
    int data[] = { 2,1,5,3,5,2,6,2};
    int length = sizeof(data)/sizeof(data[0]);
    cout<<"鍒濆搴忓垪:"<<endl;
    print(data,length);
    Bublle_sort(data,length);
    cout<<"鏈緇堢粨鏋?"<<endl;
    print(data,length);
    cout<<endl;
    system("pause");
    return 1;
}
int Bublle_sort(int data[],int n)
{
int tmp = 0;
for(int i = 0;i < n;i++)
{
    for(int j = 0;j < n-i-1;j++)
    {
            if(data[j]<data[j+1])
            {
               tmp = data[j];
               data[j] = data[j+1];
               data[j+1] = tmp;
            }
            else continue;
    }
    cout<<i+1<<"嬈℃帓搴忕粨鏋?"<<endl;
    print(data,n);
    cout<<endl;
}
    return 1;
}
int print(int data[],int n)
{
    for(int i = 0;i < n;i++)
    {
            cout<<data[i]<<" ";
    }
            cout<<endl;
}

璋冭瘯緇撴灉錛?br>



]]>
榪呴浄絎旇瘯棰?C++)http://www.shnenglu.com/shexinwei/archive/2010/09/25/127675.html椹禌鍏?07椹禌鍏?07Sat, 25 Sep 2010 14:49:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/25/127675.htmlhttp://www.shnenglu.com/shexinwei/comments/127675.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/25/127675.html#Feedback16http://www.shnenglu.com/shexinwei/comments/commentRss/127675.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/127675.html 1/////////////////////////////////////////////////
 2//榪呴浄絎旇瘯棰橈細(xì)
 3//鏈塏涓ぇ灝忎笉絳夌殑鑷劧鏁幫紙1--N錛夛紝璇峰皢瀹冧滑鐢卞皬鍒板ぇ鎺掑簭銆?nbsp;  
 4//瑕佹眰紼嬪簭綆楁硶錛氭椂闂村鏉傚害涓篛(n)錛岀┖闂村鏉傚害涓篛(1)銆?/span>
 5
 6#define TEST_XUNLEI
 7
 8#ifdef TEST_XUNLEI
 9
10#include <iostream>
11using namespace std;
12int sort(int data[],int n);
13int main()
14{
15    int data[] = {8,7,9,4,6,5,3,2,1};
16    for(int i = 0 ;i < sizeof(data)/sizeof(int);i++)
17        cout<<data[i]<<" ";
18    cout<<endl;
19    sort(data,sizeof(data)/sizeof(int));
20    system("pause");
21    return 1;
22}

23int sort(int data[],int n)
24{
25    //淇濊瘉絀洪棿澶嶆潅搴︿負(fù)O(1)
26    int tmp = 0;               
27    for(int i = 0;i < n;i++)    
28    {
29       //縐誨姩錛岀洿鍒扮data[i]涓篿+1鐨勬椂,while緇撴潫寰幆銆傚悜鍚庣戶緇垽鏂?/span>
30        while(data[i] != i+1)   
31        
32            //姣忔寰幆淇濊瘉浜哾ata[i-1]鐨勬紜傛誨叡鏈塶涓墍浠ユ椂闂村鏉傚害涓篛(N)
33            tmp = data[data[i]-1];
34            data[data[i]-1= data[i];        
35            data[i] = tmp;
36        }

37    }

38    for(int i = 0;i < n;i++)
39        cout<<data[i]<<" ";
40    cout<<endl;
41    return 1;
42}

43
44
45#endif 璇ラ鐨勯噸鐐瑰湪浜庯紝N涓?--N鐨勬暟銆?

]]>
n涓皬浜庝竴鐧句竾鍙噸澶嶆暟鐨勬帓搴?/title><link>http://www.shnenglu.com/shexinwei/archive/2010/09/20/127153.html</link><dc:creator>椹禌鍏?07</dc:creator><author>椹禌鍏?07</author><pubDate>Mon, 20 Sep 2010 09:33:00 GMT</pubDate><guid>http://www.shnenglu.com/shexinwei/archive/2010/09/20/127153.html</guid><wfw:comment>http://www.shnenglu.com/shexinwei/comments/127153.html</wfw:comment><comments>http://www.shnenglu.com/shexinwei/archive/2010/09/20/127153.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/shexinwei/comments/commentRss/127153.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/shexinwei/services/trackbacks/127153.html</trackback:ping><description><![CDATA[<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> RAND</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> RANK</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#ifdef RAND<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">time.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_102_112_Open_Image onclick="this.style.display='none'; Codehighlighter1_102_112_Open_Text.style.display='none'; Codehighlighter1_102_112_Closed_Image.style.display='inline'; Codehighlighter1_102_112_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_102_112_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_102_112_Closed_Text.style.display='none'; Codehighlighter1_102_112_Open_Image.style.display='inline'; Codehighlighter1_102_112_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">enum</span><span id=Codehighlighter1_102_112_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_102_112_Open_Text><span style="COLOR: #000000">{MAX</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">10000</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_126_324_Open_Image onclick="this.style.display='none'; Codehighlighter1_126_324_Open_Text.style.display='none'; Codehighlighter1_126_324_Closed_Image.style.display='inline'; Codehighlighter1_126_324_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_126_324_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_126_324_Closed_Text.style.display='none'; Codehighlighter1_126_324_Open_Image.style.display='inline'; Codehighlighter1_126_324_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_126_324_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_126_324_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    ofstream </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">rand.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">杈撳嚭鎬繪暟</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">MAX</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><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    srand((unsigned </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)time(NULL));<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> MAX;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_249_272_Open_Image onclick="this.style.display='none'; Codehighlighter1_249_272_Open_Text.style.display='none'; Codehighlighter1_249_272_Closed_Image.style.display='inline'; Codehighlighter1_249_272_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_249_272_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_249_272_Closed_Text.style.display='none'; Codehighlighter1_249_272_Open_Image.style.display='inline'; Codehighlighter1_249_272_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_249_272_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_249_272_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">rand()</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><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000">.close();<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">out over</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#endif</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#ifdef RANK<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_398_836_Open_Image onclick="this.style.display='none'; Codehighlighter1_398_836_Open_Text.style.display='none'; Codehighlighter1_398_836_Closed_Image.style.display='inline'; Codehighlighter1_398_836_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_398_836_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_398_836_Closed_Text.style.display='none'; Codehighlighter1_398_836_Open_Image.style.display='inline'; Codehighlighter1_398_836_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_398_836_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_398_836_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> max </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    ifstream </span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">rand.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鑾峰彇瑕佹帓搴忔暟鐨勪釜鏁?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">max;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒濆鍖栫粺璁℃暟緇?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">num </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">[RAND_MAX];<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> max;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_537_554_Open_Image onclick="this.style.display='none'; Codehighlighter1_537_554_Open_Text.style.display='none'; Codehighlighter1_537_554_Closed_Image.style.display='inline'; Codehighlighter1_537_554_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_537_554_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_537_554_Closed_Text.style.display='none'; Codehighlighter1_537_554_Open_Image.style.display='inline'; Codehighlighter1_537_554_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_537_554_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_537_554_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        num[i] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> tmp </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">璇誨彇鏁版嵁錛屽茍緇熻</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></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"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> max;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_610_641_Open_Image onclick="this.style.display='none'; Codehighlighter1_610_641_Open_Text.style.display='none'; Codehighlighter1_610_641_Closed_Image.style.display='inline'; Codehighlighter1_610_641_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_610_641_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_610_641_Closed_Text.style.display='none'; Codehighlighter1_610_641_Open_Image.style.display='inline'; Codehighlighter1_610_641_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_610_641_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_610_641_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">tmp;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        num[tmp] </span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">杈撳嚭</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    ofstream </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">out.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (i </span><span style="COLOR: #000000">=</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"> max;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_702_798_Open_Image onclick="this.style.display='none'; Codehighlighter1_702_798_Open_Text.style.display='none'; Codehighlighter1_702_798_Closed_Image.style.display='inline'; Codehighlighter1_702_798_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_702_798_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_702_798_Closed_Text.style.display='none'; Codehighlighter1_702_798_Open_Image.style.display='inline'; Codehighlighter1_702_798_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_702_798_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_702_798_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(num[i] </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </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"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> num[i];j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_759_795_Open_Image onclick="this.style.display='none'; Codehighlighter1_759_795_Open_Text.style.display='none'; Codehighlighter1_759_795_Closed_Image.style.display='inline'; Codehighlighter1_759_795_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_759_795_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_759_795_Closed_Text.style.display='none'; Codehighlighter1_759_795_Open_Image.style.display='inline'; Codehighlighter1_759_795_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=Codehighlighter1_759_795_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_759_795_Open_Text><span style="COLOR: #000000">{ </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鏈夊涓紝鍒欒緭鍑哄涓?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">i</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><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000">.close();<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">.close();<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#endif</span></div> <img src ="http://www.shnenglu.com/shexinwei/aggbug/127153.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/shexinwei/" target="_blank">椹禌鍏?07</a> 2010-09-20 17:33 <a href="http://www.shnenglu.com/shexinwei/archive/2010/09/20/127153.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍒ゆ柇鏁村瀷鏁頒腑姣忎竴浣嶇殑鍊?C++)http://www.shnenglu.com/shexinwei/archive/2010/09/13/126526.html椹禌鍏?07椹禌鍏?07Mon, 13 Sep 2010 12:48:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/13/126526.htmlhttp://www.shnenglu.com/shexinwei/comments/126526.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/13/126526.html#Feedback4http://www.shnenglu.com/shexinwei/comments/commentRss/126526.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/126526.html
 1/*
 2Subject:        the value of the each bit on int
 3Author:         shexinwei
 4School:         xidian university
 5Date:           2010-09-13
 6Laguage:        C++
 7IDE:            visual studio 6.o
 8Version:        1.0
 9Modify Time:    2010-09-13
10*/

11#include <iostream>
12using namespace std;
13int main()
14{
15    int i = 0;
16    cout<<"please input the number:";
17    cin>>i;
18    char *result = new char[sizeof(int)*8];
19    int j = 1;
20    for (int k = 0;k<sizeof(int)*8;(j=j<<1),k++)
21    {
22        if ( (i&j) == 0 )
23        {
24            result[k] = '0';
25        }

26        else result[k] = '1';
27    }

28    for (int m = sizeof(int)*8-1;m >=0 ; m--)
29{
30        cout<<result[m];
31    }

32    cout<<endl;
33    delete []result;
34    return 1;
35}


]]>
蹇熸帓搴?C++)http://www.shnenglu.com/shexinwei/archive/2010/09/12/126468.html椹禌鍏?07椹禌鍏?07Sun, 12 Sep 2010 09:02:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/12/126468.htmlhttp://www.shnenglu.com/shexinwei/comments/126468.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/12/126468.html#Feedback1http://www.shnenglu.com/shexinwei/comments/commentRss/126468.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/126468.html  1 //鐗堟潈澹版槑錛氳漿杞芥椂璇蜂互瓚呴摼鎺ュ艦寮忔爣鏄庢枃绔犲師濮嬪嚭澶勫拰浣滆呬俊鎭強(qiáng)鏈0鏄?br>  2 //http://shexinwei.blogbus.com/logs/74827291.html
  3 
  4 
  5 /*
  6 
  7 Subject:      Quick sort
  8 
  9 Author:       shexinwei
 10 
 11 School:       xidian university
 12 
 13 Date:         2010-09-12
 14 
 15 Laguage:      C++
 16 
 17 IDE | Tool:   GCC
 18 
 19 Version:      1.0
 20 
 21 Modify Time:  2010-09-12
 22 
 23 */    
 24 
 25 #include <iostream>
 26 
 27 using namespace std;
 28 
 29 int sort(int begin,int end,int data[],int n);
 30 
 31 int recurs(int begin,int end,int data[],int n);
 32 
 33 int print(int data[],int n);
 34 
 35 int main()
 36 
 37 {
 38 
 39     int data[] = {20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
 40 
 41     //鎵撳嵃鍒濆搴忓垪
 42 
 43     print(data,20);
 44 
 45     //閫掑綊鎺掑簭
 46 
 47     recurs(0,19,data,20);
 48 
 49     //鎵撳嵃鏈緇堝簭鍒?nbsp;   
 50 
 51     print(data,20);
 52 
 53     cout<<endl;
 54 
 55         return 1;
 56 
 57 }
 58 
 59  
 60 
 61 //鎵撳嵃搴忓垪
 62 
 63 int print(int data[],int n)
 64 
 65 {
 66 
 67     for(int i = 0;i<n;i++)
 68 
 69         cout<<data[i]<<" ";
 70 
 71     cout<<endl;
 72 
 73     return 1;
 74 
 75 }
 76 
 77  
 78 
 79  
 80 
 81 int sort(int begin,int end,int data[],int n)
 82 
 83 {
 84 
 85     //閫夋嫨鏈鍚庝竴浣嶅仛鍒濆鐨勪腑鏋?/span>
 86 
 87     int pos = end;
 88 
 89     int key  = data[end];
 90 
 91     //绱㈠紩鍒濆鍖?/span>
 92 
 93     int front = begin;
 94 
 95     int last = end;
 96 
 97     for(;front != last;front++)
 98 
 99     { //鍚戝悗鏌ユ壘
100 
101  
102 
103         if((data[front] < key) || (data[front] == key)) continue;
104 
105         else
106 
107         { //閬囧埌姣斾腑鏋㈠煎ぇ鐨勫厓绱狅紝浜ゆ崲浣嶇疆錛屼慨鏀筽os鐨勫鹼紝騫跺紑濮嬩粠鍚庡悜鍓嶆壘
108 
109             data[pos] = data[front];
110 
111             pos = front;
112 
113             //浠ヤ笅涓鍙ュ彲娉ㄩ噴錛屽彧闇瑕佷繚瀛樹腑鏋㈢殑浣嶇疆錛屽彲浠ヤ笉淇敼鍊鹼紝鍥犱腑鏋㈠煎湪key涓繚瀛橈紝鏈鍚庢壘鍒版渶緇堜綅緗悗鍐嶈祴鍊煎嵆鍙?/span>
114 
115             data[pos] = key;     
116 
117             //杈撳嚭鏀瑰彉涓嬈″悗鐨勫簭鍒?/span>
118 
119             print(data,n);
120 
121             for(;front != last;last--)
122 
123             {//浠庡悗鍚戝墠鏌ユ壘
124 
125                 if((data[last] > key)||(data[last] == key)) continue;
126 
127                 else
128 
129                 { //閬囧埌姣斾腑鏋㈠煎皬鐨勫厓绱狅紝浜ゆ崲浣嶇疆錛屼慨鏀筽os鍊鹼紝騫墮噸鏂板紑濮嬩粠鍓嶅悜鍚庢煡鎵?/span>
130 
131                    data[pos] = data[last];
132 
133                    pos = last;
134 
135                  //浠ヤ笅涓鍙ュ彲娉ㄩ噴錛屽彧闇瑕佷繚瀛樹腑鏋㈢殑浣嶇疆錛屽彲浠ヤ笉淇敼鍊鹼紝鍥犱腑鏋㈠煎湪key涓繚瀛橈紝鏈鍚庢壘鍒版渶緇堜綅緗悗鍐嶈祴鍊煎嵆鍙?/span>
136 
137                        data[pos] = key;
138 
139                  //鎵撳嵃淇敼浠ュ悗鐨勫簭鍒?/span>
140 
141                    print(data,n); 
142 
143                  //閲嶆柊寮濮嬩粠鍓嶅悜鍚庢煡鎵?/span>
144 
145                    break;
146 
147                 }
148 
149             }
150 
151             
152 
153         }
154 
155         //濡傛灉浠庡悗鍚戝墠宸茬粡浣垮緱front==last錛岄偅涔堜竴瓚熷垎鍓插畬姣?/span>
156 
157         if(front == last) break;
158 
159     }
160 
161     data[pos] = key;
162 
163     return pos;
164 
165 }
166 
167 int recurs(int begin,int end,int data[],int n)
168 
169 {
170 
171     //閫掑綊鍑哄彛
172 
173     if((begin == end) || (begin > end)) return 1;
174 
175     else
176 
177     {
178 
179     //鍋氬垎鍓?/span>
180 
181     int index = sort(begin,end,data,n);
182 
183     //鍓嶄竴閮ㄥ垎閫掑綊
184 
185     recurs(begin,index-1,data,n);
186 
187     //鍚庝竴閮ㄥ垎閫掑綊
188 
189     recurs(index+1,end,data,n);
190 
191     }
192 
193 }

]]>
the difference of some Input functionhttp://www.shnenglu.com/shexinwei/archive/2010/09/10/126284.html椹禌鍏?07椹禌鍏?07Fri, 10 Sep 2010 00:44:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/10/126284.htmlhttp://www.shnenglu.com/shexinwei/comments/126284.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/10/126284.html#Feedback0http://www.shnenglu.com/shexinwei/comments/commentRss/126284.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/126284.html 1 /* 2 Subject: the difference of gets(),getch(),getchar() and getline() 3 Author: shexinwei 4 School: xidian university 5 Date: 2010-09-09 6 Laguage: C++ 7 IDE: visual studio 6.o 8 Version: 1.0 9 Modify Time: 2010-09-09 10 */ 11 #include <iostream> 12 using namespace std; 13 #include <conio.h> 14 #define MAX_LEN 20 15 int main() 16 { 17 18 //gets() : Get a line from the stdin stream. 19 //Get a line from the stdin stream. 20 21 cout<<"the function gets():"<<endl; 22 char buffer[MAX_LEN]; 23 gets(buffer); 24 cout<<buffer<<endl; 25 26 // getchar(): 27 // marco: #define getchar() getc(stdin) File: STDIO.H Get a character from a file; 28 // function: _CRTIMP int __cdecl getchar(void); File: STDIO.H Get a character from stdin; 29 char tmp = 0; 30 cout<<endl<<endl<<"the function getchar():"<<endl; 31 cout<< (char)getchar(tmp) <<endl; 32 33 //getline(): 34 //basic_istream<Elem, Tr>& getline(char_type *_Str, streamsize _Count); 35 //Gets a line from the input stream. 36 cout<<endl<<endl<<"the function getline():"<<endl; 37 cin.getline(buffer,MAX_LEN); 38 cout<<buffer<<endl; 39 40 //getch(): 41 //This POSIX function is deprecated beginning in Visual C++ 2005. Use the ISO C++ conformant _getch instead 42 //Gets a character from the console without echo. 43 //int _getch( void ); 44 //Returns the character read. There is no error return. 45 //Headers: <conio.h> 46 cout<<endl<<endl<<"the function getch():"<<endl; 47 tmp = getch(); //without echo 48 // cout<<tmp<<endl; //print the character 49 50 51 system("pause"); 52 return 0; 53 54 }

]]>
鐗堟潈澹版槑鏂囨。http://www.shnenglu.com/shexinwei/archive/2010/09/10/126283.html椹禌鍏?07椹禌鍏?07Fri, 10 Sep 2010 00:41:00 GMThttp://www.shnenglu.com/shexinwei/archive/2010/09/10/126283.htmlhttp://www.shnenglu.com/shexinwei/comments/126283.htmlhttp://www.shnenglu.com/shexinwei/archive/2010/09/10/126283.html#Feedback0http://www.shnenglu.com/shexinwei/comments/commentRss/126283.htmlhttp://www.shnenglu.com/shexinwei/services/trackbacks/126283.html

浣滀負(fù)涓涓笓涓氱殑紼嬪簭鍛橈紝鎴戜滑闇瑕佸湪姣忎竴涓簮鏂囦歡涓仛涓浜涚増鏉冨0鏄庢х殑娉ㄩ噴銆傜幇鍦ㄦ牴鎹垜鎵瑙佸埌鐨勶紝鍜岃嚜宸辯殑鐞嗚В錛屽畾涔変竴浠藉睘浜庢垜鑷繁鐨勭増鏉冨0鏄庢枃妗f牸寮忋備笉瓚充箣澶勬棩鍚庣戶緇坊鍔犺ˉ鍏呫?/p>

紺轟緥

1 /* 2 Subject: the difference of gets(),getch(),getchar() and getline() 3 Author: shexinwei 4 School: xidian university 5 Date: 2010-09-09 6 Laguage: C++ 7 IDE: visual studio 6.o 8 Version: 1.0 9 Modify Time: 2010-09-09 10 */




]]>
久久超乳爆乳中文字幕| 无码伊人66久久大杳蕉网站谷歌| 伊人久久五月天| 99久久国产综合精品麻豆| 久久综合久久性久99毛片| 99久久无色码中文字幕| 久久午夜无码鲁丝片秋霞| 国产精品一区二区久久精品| 日本WV一本一道久久香蕉| 久久国产视频网| 久久久精品午夜免费不卡| 一本色道久久99一综合| 亚洲欧美精品一区久久中文字幕 | 久久精品夜色噜噜亚洲A∨| 久久久久国产精品熟女影院| 老司机午夜网站国内精品久久久久久久久 | 久久国产精品99久久久久久老狼| 久久精品成人欧美大片| 日韩十八禁一区二区久久| 99久久亚洲综合精品网站| 97久久久久人妻精品专区| 人妻精品久久久久中文字幕一冢本| 亚洲国产精品无码久久青草| 精品人妻伦九区久久AAA片69| 日本久久久久久中文字幕| 久久91精品久久91综合| 国产精品久久毛片完整版| 国产精品99久久免费观看| 嫩草伊人久久精品少妇AV| 人妻丰满AV无码久久不卡| 亚洲AV无一区二区三区久久| 久久九九久精品国产免费直播| 免费精品国产日韩热久久| 中文成人无码精品久久久不卡 | 亚洲а∨天堂久久精品9966| 久久精品国产亚洲Aⅴ香蕉| 久久久久亚洲AV成人网人人软件| 久久精品免费大片国产大片| 日本精品一区二区久久久| 久久久午夜精品福利内容| 日韩欧美亚洲综合久久 |