include <iostream>
#include <stack>
#include <string>
using namespace std;
string to_string(long long n){
string s = "";
while (n > 0){
s = char (n%10 + '0') + s;
n /= 10;
}
return s;
}
int main(){
string s;
getline(cin, s);
s=s+"@";
stack<char> st;
string a ="";
for(int i =0;i<s.length();i++){
if(st.empty() == true || s[i]==st.top()){
st.push(s[i]);
} else{
int count = 0;
a = a + st.top();
while(st.empty()!=true){
count ++;
st.pop();
}
a = a+to_string(count);
st.push(s[i]);
}
}
cout << a;
}
cho em hỏi tại sao phải thêm @ vào sau chuỗi ạ??