杭电ACM 水题 Encoding

杭电ACM 水题 Encoding
Problem Description
Given a string containing only 'A' - 'Z', we could encode it using the following method:
1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.
2. If the length of the sub-string is 1, '1' should be ignored.
Input
The first line contains an integer N (1
江凌萧萧生 1年前 已收到1个回答 举报

随云Cloud 幼苗

共回答了22个问题采纳率:72.7% 举报

#include
#include
main()
{
int a;
int n,i,l;
char b[10001];
scanf("%d",&n);
while(n--)
{
memset(b,'',10001);
scanf("%s",b);
l=strlen(b);
i=0;
a=1;
while(i

1年前 追问

4

江凌萧萧生 举报

我的哪里不对了?

举报 随云Cloud

ABBCCBBCC 正确答案是A2B2C2B2C 你给的答案是A4B4C

江凌萧萧生 举报

他不就是这个意思吗?
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.170 s. - webmaster@yulucn.com