锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲综合久久系列,麻豆久久久9性大片,久久WWW免费人成—看片http://www.shnenglu.com/xmli/category/8869.html銇烽洩椋樼粵姊呮槧孌嬬孩 <br> &nbsp;&nbsp; 銇瘋姳鑸為湝椋炴槧鑻嶆澗<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----- Do more,suffer lesszh-cnFri, 21 Nov 2008 12:31:30 GMTFri, 21 Nov 2008 12:31:30 GMT60浜旂瑪緙栫爜鏌ヨhttp://www.shnenglu.com/xmli/archive/2008/11/20/67389.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Thu, 20 Nov 2008 08:54:00 GMThttp://www.shnenglu.com/xmli/archive/2008/11/20/67389.htmlhttp://www.shnenglu.com/xmli/comments/67389.htmlhttp://www.shnenglu.com/xmli/archive/2008/11/20/67389.html#Feedback0http://www.shnenglu.com/xmli/comments/commentRss/67389.htmlhttp://www.shnenglu.com/xmli/services/trackbacks/67389.html  鍊熺敤緙栫爜琛紝鏌ヨ瀵瑰簲姹夊瓧鐨勪簲絎旂紪鐮侊細(xì)

  灝忎箵緇冮錛?br>
int main(int argc, char* argv[]) 
{
    
if (argc==1)
    {
        std::cout
<<"鐢ㄦ硶: wubi <闇瑕佹煡璇㈢紪鐮佺殑姹夊瓧>"<<std::endl;
        
return 0;
    }
    
// 鏂囦歡璺緞
    char* szPath = "wubi.txt";

    std::ifstream fin(szPath);
    
if (!fin)
    {
        std::cout
<<"鏃犳硶鎵撳紑浜旂瑪緙栫爜鏂囦歡錛屾枃浠跺悕wubi.txt錛岃緗簬wubi.exe鍚岀洰褰曚腑"<<std::endl;
        
return -1;
    }
    
// 閫氬父鎴戜滑榪欐牱璇誨彇涓涓枃鏈枃浠剁殑鍏ㄦ枃
    std::string strText = std::string(std::istreambuf_iterator<char>(fin), std::istreambuf_iterator<char>());


    typedef std::map
<std::string, std::string> WubiMap;
    WubiMap wubiMap;

    
int nLength = strText.length();
    
int nLeft = 0;
    
int nRight = -1;

    
// 璇誨叆浜旂瑪緙栫爜
    std::string strWord; 
    std::
string strCode; 
    
while(nRight < nLength)
    {
        nLeft 
= nRight+1;
        nRight 
= nLeft+1;
        
//tab鍓嶇殑閮ㄥ垎涓簁ey:strWord
        while (nRight<nLength && strText[nRight] != '\t')
        { 
            nRight
++;
        }
        
if(nRight < nLength)
        {
            strWord 
= strText.substr(nLeft, nRight - nLeft);
        }

        nLeft 
= nRight + 1;
        nRight 
= nLeft + 1;
        
//鍥炶濺鍓嶇殑涓篊ode
        while (nRight<nLength && strText[nRight] != '\n')
        {
            nRight
++;
        }
        
if(nRight < nLength)
        {
            strCode 
= strText.substr(nLeft, nRight - nLeft);
            wubiMap[strWord]
= strCode;     
        }

    }
    
    
// 寰幆鏌ユ壘鐩稿叧姹夊瓧鐨勭紪鐮?/span>
    std::string strLine=argv[1];
    nLength
= strLine.length();
    
for (int i=0; i<nLength; ++i)
    {
        
// 鍒ゆ柇鏄眽瀛楃殑鍓嶅崐閮ㄥ垎
        if (strLine[i]<0)
        {
            strWord
= strLine.substr(i, 2);
            std::cout
<<strWord<<"\t"<<wubiMap[strWord]<<std::endl;
            
++i;
        }
else
        {
            std::cout
<<strLine[i]<<"\t"<<"鏃犲搴旂紪鐮?/span>"<<std::endl;
        }
    }

    
return 0;
}

  紺轟緥錛?br>D:\>wubi 鎴戞槸涓鏈功
 鎴?nbsp; trnt
 鏄?nbsp; jghu
 涓  ggll
 鏈?nbsp; sgd
 涔?nbsp; nnhy

闄勶細(xì)python瑙e喅鏂規(guī)涓涓細(xì)
import sys

wbx
={
'宸?/span>':'aaaa',
'寮?/span>':'aad',

'璋?/span>':'yywf',
'':'yyyy',
'寰?/span>':'ttgg',
'涓?/span>':'gii'}

if len(sys.argv)==1:
    
print('wubi <闇瑕佹煡鎵句簲絎旂紪鐮佺殑姹夊瓧>')
    sys.exit(
1)
argv
=sys.argv[1:]
for line in argv:
    
for c in line:
        
if c in wbx:
            
print(' %s  %s'%(c, wbx[c]))
        
elif ord(c)<128 or c in '錛屻傦紒~“”錛?/span>':
            
print(' %s'%c)
        
else:
            
print(' %s  -->緙栫爜緙哄け'%c)

闄勶細(xì)浜旂瑪緙栫爜琛ㄤ竴寮狅細(xì) wubi.7z


  灝忎箵鍔犳補(bǔ) :D

 


]]>
鍗曡瘝緇熻http://www.shnenglu.com/xmli/archive/2008/11/19/67260.html鏉庣幇姘?/dc:creator>鏉庣幇姘?/author>Wed, 19 Nov 2008 02:29:00 GMThttp://www.shnenglu.com/xmli/archive/2008/11/19/67260.htmlhttp://www.shnenglu.com/xmli/comments/67260.htmlhttp://www.shnenglu.com/xmli/archive/2008/11/19/67260.html#Feedback0http://www.shnenglu.com/xmli/comments/commentRss/67260.htmlhttp://www.shnenglu.com/xmli/services/trackbacks/67260.html
灝忎箵緇冮錛?br>
int main(int argc, char* argv[]) 
{    
    
using namespace std;

    ifstream infile(
"c:\\a.txt",ios::binary );
    
if(!infile)
    {
        cout
<<"Can not open sourse file!"<<endl;
        
return 0;
    }
    
//ofstream outfile("out.txt");
    
//if(!outfile)
    
//{
    
//    cout<<"Can not open destination file!"<<endl;
    
//}
    
    
int nLength = 0;
    
char * pBuffer;

    
// get length of file:
    infile.seekg (0, ios::end);
    nLength 
= infile.tellg();
    infile.seekg (
0, ios::beg);
    
    
    
//read the file to the buffer
    pBuffer = new char[nLength];
    memset(pBuffer, 
0, nLength);
    infile.read(pBuffer,nLength);
    infile.close();

    
//copy the buffer to the string s
    string s = pBuffer;
    delete[] pBuffer;
    pBuffer 
= NULL;


    
string temp;

    vector
<string> vecSubstr;
    vector
<int> vecCount;

    
int pre=0,next=0;

    
while(next<nLength)
    {
        pre
=next;
        
//find the word
        while((next<nLength)&&isalnum(s[next]))
        {
            next
++;
        }
        
if(pre!=next)
        {
            
//璁$畻褰撳墠鐨勫崟璇嶄釜鏁?/span>
            temp = s.substr(pre,next-pre);
            cout
<<temp<<endl;
            
//std::vector<std::string>::iterator iter = std::find(vecSubstr.begin(), vecSubstr.end(), temp);
            
//if (vecSubstr.end() != iter)
            
//{
            
//    std::cout<<temp<<std::endl;
            
//}else
            
//{
            
//    vecSubstr.push_back(temp);
            
//}

            unsigned 
int iPosition=0;
            

            
while(iPosition<vecSubstr.size())
            {
                
                
if(vecSubstr[iPosition].compare(temp)==0)
                    
break;
                    
                iPosition
++;
                
            }
            
            
if (iPosition==vecSubstr.size())
            {
                vecSubstr.push_back(temp);
                vecCount.push_back(
1);
            }
            
else
            {
                vecCount[iPosition]
++;
            }            
            
        }
        next
++;
    }
    
for (int j=0;j<vecSubstr.size();j++)
    {
        cout
<<vecSubstr[j]<<endl<<vecCount[j]<<endl;
    }

    
//for(int i=0;i<substr.size();i++)
    
//{
    
//    cout<<substr[i]<<endl;
    
//    cout<<count[i]<<endl;
    
//}

    
//delete[] pBuffer;
    
//pBuffer = NULL;

    system(
"pause");

    
return 0;
}

C++浠g爜錛?br>
int main(int argc, char* argv[])
{
    
    
// 鏂囦歡璺緞
    char* szPath = "C:\\text.txt";
    
    std::ifstream fin(szPath);
    
if (!fin)
    {
        std::cout
<<"Can not open file"<<std::endl;
        
return -1;
    }
    
// 閫氬父鎴戜滑榪欐牱璇誨彇涓涓枃鏈枃浠剁殑鍏ㄦ枃
    std::string strText = std::string(std::istreambuf_iterator<char>(fin), std::istreambuf_iterator<char>());

    typedef std::map
<std::stringint> CountMap;
    CountMap counter;

    
int nLength = strText.length();
    
int nLeft = 0;
    
int nRight = -1;

    
while(nRight<nLength)
    {
        nLeft 
= nRight+1;
        
// 鎵懼埌絎竴涓槸瀛楁瘝鐨勪綅緗?/span>
        while (nLeft<nLength && !isalnum(strText[nLeft]))
        {
            
++nLeft;
        }
        nRight 
= nLeft+1;
        
// 鎵懼埌絎竴涓潪瀛楁瘝鐨勪綅緗?/span>
        while (nRight<nLength && isalnum(strText[nRight]))
        {
            
++nRight;
        }
        
// 鍙杗Right-nLeft鍙互淇濊瘉鍙栧埌鐨勬槸涓涓獁ord錛屽叾涓笉浼?xì)鍚湁瀛椊W?/span>
        if (nRight < nLength)
        {
            
// 鎻愬彇鍗曡瘝
            std::string strWord = strText.substr(nLeft, nRight - nLeft);
            
// 鍔犲叆璁版暟鍣?/span>
            counter[strWord]+=1;    
        }        
    }
    
    
// 鎵撳嵃杈撳嚭
    for (CountMap::iterator iter = counter.begin(); counter.end()!=iter; ++iter)
    {
        std::cout
<<iter->first<<"\t\t"<<iter->second<<std::endl;
    }

    system(
"pause");
    
return 0;
}

python 浠g爜錛?br>
import re

filepath
=r'c:/text.txt'
with open(filepath) as file:
    text
=file.read()
    text
=re.split('\W+', text)
    d
={}
    
for item in text:
        d[item]
=d.get(item, 0) +1 
    
for key, value in d.items():
        
print('%s\t\t%s'%(key, value))

灝忎箵鍔犳補(bǔ)錛?br>















]]>
久久久久亚洲AV无码永不| 久久久久一级精品亚洲国产成人综合AV区| .精品久久久麻豆国产精品| 久久亚洲天堂| 国产成人无码精品久久久久免费| 久久精品人人做人人爽97| 久久精品国产99国产精品亚洲| 亚洲国产日韩欧美综合久久| 久久99精品免费一区二区| 国产AV影片久久久久久| 日韩一区二区久久久久久| 国产精品一久久香蕉产线看 | 亚洲AV乱码久久精品蜜桃| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 亚洲精品蜜桃久久久久久| 2021国产精品久久精品| 久久无码AV一区二区三区| 亚洲精品乱码久久久久久蜜桃不卡 | 婷婷久久五月天| 一级女性全黄久久生活片免费 | 国产一区二区精品久久凹凸 | 亚洲精品无码久久久久sm| 国产精品无码久久久久久| 91性高湖久久久久| 久久精品国产一区二区电影| 色播久久人人爽人人爽人人片aV | 亚洲日韩中文无码久久| 国产一级做a爰片久久毛片| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久久久亚洲AV成人片| 四虎国产精品免费久久5151| 一本一道久久精品综合| 2020久久精品亚洲热综合一本| 香蕉久久av一区二区三区| 伊人久久大香线焦综合四虎| 久久精品无码一区二区三区免费| 久久婷婷人人澡人人爽人人爱| 亚洲欧美日韩久久精品第一区| 亚洲天堂久久精品| 亚洲精品美女久久777777| 久久中文字幕无码专区|