// 一个循环搞定
void (async function () {
const str = await readline();
let tep = "", count = 0, res = ""
for (const char of str) {
if (tep != char) {
if (tep != "") {
res += `${count}${tep}`;
}
count = 1;
} else {
count++;
}
tep = char;
}
res += `${count}${tep}`
console.log(res)
})();

京公网安备 11010502036488号