xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介


文本: a b c a c a d b a c d a b a a c b a b a 傳統(tǒng)表示方法:a: 00, b: 01, c: 10, d: 11 傳統(tǒng)表示未壓縮時(shí): 0001100010001101001011001000001001001000 統(tǒng)計(jì)次數(shù):a:9, b:5, c:4, d:2 前綴碼表示:a: 0, b: 10, c:110, d:111 壓縮后: 0101100110011110011011101000110100100

資源截圖

代碼片段和文件信息

#include
#include
#include
using?namespace?std;
typedef?struct?SC
{
char?ss[100];//所有字符串
char?s[100];//不重復(fù)的字符串
int?si[100];//每個(gè)字符的總數(shù)
int?per[100];
int?i;//字符數(shù)
string?str[100];//code
int?count;//總數(shù)
double?CountPer;//壓縮率
int?mixlen;//編碼的最長(zhǎng)長(zhǎng)度
}SC;
void?MaxLen(SC?&s);
string?OutHufCode(char?cSC?s);
double?compress(SC?s);
void?HufumanCode(SC?&s);
void?InitSC(SC?&s);
int?Search(SC?schar?c);
void?SortSC(SC?&s);
int?main()
{
ifstream?fin(“Input.txt“);
ofstream?fout(“Output.txt“);
char?cc1;
SC?s;InitSC(s);

int?i=0;
while(!fin.eof())
{
fin>>c;
if(fin.get()==‘\n‘)
break;
s.ss[s.count++]=c;
if(Search(sc)==-1)
{
s.s[s.i]=c;
s.si[s.i]++;
s.i++;
}
else
{
s.si[Search(sc)]++;
}
}
for(i=0;i {
cout< }
SortSC(s);
cout<<“**********\n“;
for(i=0;i {
cout< }
cout<<“**********\n“;
for(i=0;i

評(píng)論

共有 條評(píng)論