怎麼壓縮字母
㈠ 電腦中文件怎麼壓縮
方法如下:
1、首先需要下載一個壓縮工具,打開瀏覽器,找到WinRAR壓縮工具,先下載好,待會用來壓縮文件。
㈡ c語言字元串如何壓縮
話說B數組不應該是整形呀,不然不能保存字母了。以下是我的代碼。。。
#include<iostream>
#include<string.h>
#include<stdio.h>
usingnamespacestd;
voidyasuo(chara[],charb[])
{
intcount=1,p=0;
for(inti=0;i<strlen(a);i++)
if(a[i]==a[i+1])
count++;
elseif(count>2)
{
b[p++]=(char)(count+'0');
b[p++]=a[i];
count=1;
}
elseif(count==2)
{
b[p++]=a[i];
b[p++]=a[i];
count=1;
}
else
b[p++]=a[i];
}
voidprintB(charb[])
{
cout<<b<<endl;
}
voidbackB(charb[])
{
for(inti=0;i<strlen(b);i++)
if(b[i]<='9'&&b[i]>='3')
{
for(intj=0;j<(int)(b[i]-'0');j++)
cout<<b[i+1];
i++;
}
else
cout<<b[i];
cout<<endl;
}
intmain()
{
chara[1000]={0},b[1000]={0};
gets(a);
yasuo(a,b);
printB(b);
backB(b);
}
㈢ 怎麼壓縮文件
手機上面可以在文件管理裡面對文件進行壓縮。
以華為手機為例:
1、首先,打開手機,找到手機上面的實用工具。
你是想自己寫代碼實現解壓縮的功能,還是只是在代碼中調用命令來解壓,system()找到你的解壓縮工具在加相應的參數
㈤ C語言求助:請編寫一個字元串壓縮程序,將字元串中連續出席的重復字母進行壓縮,並輸出壓縮後的字元串。
#include <stdio.h>
void stringZip(const char
*pInputStr, long lInputLen, char *pOutputStr)
{ int n=1;
char c,*p1=pInputStr,*p2=pOutputStr;
while(*p1)
{
c=*(p1++);
while(*p1==c){n++;p1++;}
if(n>1)
{
if(n>999){*(p2++)=48+n/1000; n/=10;}
if(n>99){*(p2++)=48+n/100; n/=10;}
if(n>9){*(p2++)=48+n/10; n/=10;}
*(p2++)=48+n;
}
*(p2++)=c;
n=1;
}
*p2='