游程编码 题解:
P1103
发布于2026年2月8日 16:33
阅读数 55
#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[110];
scanf("%s",s);
int l=strlen(s);
char now=s[0];
int count=1;
for(int i=1;i<l;i++)
{
if(s[i]==now)
{
count++;
}
else{
printf("%d",count);
printf("%c",now);
now=s[i];
count=1;
}
}
if(count!=0)
{
...
登录后发布评论
暂无评论,来抢沙发