栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

洛谷题目《黑白图像压缩》

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

洛谷题目《黑白图像压缩》

参考网址
https://www.luogu.com.cn/problem/P2556

#include
#include

using namespace std;

//处理中中间的位图(补充说明:题目中提到连续1或0的个数不超过128即可以用7个位来存,所以不用考虑count>128的情况)
void HandleBitMap(unsigned char &x,unsigned char &head,unsigned char &count)
{
	for(int i=0;i<8;i++,x=x<<1)
	{
		if(head==0x80)
		{
			if( (x & 0x80) == 0x80)
			{
				count++;
				continue;
			}
			else
			{
				unsigned char data=(head|count);
				//cout<<"head: "<<"1   count: "<<(int)count<>n;
	for(int i=0;i>则容易出错,因为它默认输入为字符了
		scanf("%d",&a[i]);
		//cout<<(int)a[i]<
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/312361.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号