91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.90KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-03-27
  • 語言: C/C++
  • 標簽: c??

資源簡介


算數編碼編解碼C++程序 親自測試可用 供學習使用

資源截圖

代碼片段和文件信息

#include
#include“math.h“

char?S[100]?A[10];
float??P[10]f[10]gFs;
void?bianma(int?aint?h)
{
int?ij;
float?fr;
float?ps=1;
float?Fs=0;
float?Sp[100]b[100]F[100];
for(i=0;i {
for(j=0;j {
if(S[i]==A[j])
{
Sp[i]=P[j];
fr=f[j];
}

}
Fs=Fs+ps*fr;
ps*=Sp[i];//求Ps
// b[i]=ps;

}

cout<<“Fs=“< gFs=Fs;
float?l=log(1/ps)/log(2);
if(l>(int)l)l=(int)l+1;
else?l=int(l);
// cout< int?d[20];
//float?x;
int?m=0;
while(l>m)//轉換為二進制
{
Fs=2*Fs;
if(Fs>1)
{
Fs=Fs-1;
d[m]=1;
}
else?if(Fs<1)d[m]=0;
else?{d[m]=1;break;}
?m++;

}
int?z=m;
if(m>=l)
{
while(1)
{ ?? ??
d[m-1]=(d[m-1]+1)%2;//最后位加1
if(d[m-1]==1)break;
else?m--; ??
}

}

//if(d[m-1]==)
//cout< cout<<“s=“;
for(int?e=0;e cout< cout<
// return?Fs;

}

void

評論

共有 條評論