欢迎来到天天文库
浏览记录
ID:52524306
大小:14.88 KB
页数:2页
时间:2020-03-28
《C语言版实现地自适应算术编码.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include"stdio.h"#include"string.h"#include"stdlib.h"#defineN10intNUM;charOrin[100];floatencode;typedefstruct{charc;floatSumCh;}CO;COcode[N];voidEncode(chars[],COcode[],floatbase);main(){inti;printf("请输入码源数目:");scanf("%d",&NUM);getchar();printf("theNumis%d",NUM);floatbase=(longdouble)(1/(longdo
2、uble)NUM);printf("Chance:%lf",base);for(i=0;i3、thigh,low;count=strlen(s);for(i=0;i4、("%f-------%f",low,high);break;}}if(s[i]=='!')//结束{encode=(low+high)/2;printf("最终编码结果:");printf("%.3f",encode);}}system("PAUSE");}
3、thigh,low;count=strlen(s);for(i=0;i4、("%f-------%f",low,high);break;}}if(s[i]=='!')//结束{encode=(low+high)/2;printf("最终编码结果:");printf("%.3f",encode);}}system("PAUSE");}
4、("%f-------%f",low,high);break;}}if(s[i]=='!')//结束{encode=(low+high)/2;printf("最终编码结果:");printf("%.3f",encode);}}system("PAUSE");}
此文档下载收益归作者所有