Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
78114 sh25_wanghy 字符串p型编码 C++ Accepted 0 MS 240 KB 410 2025-12-26 15:23:00

Tests(1/1):


#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; string encoded; for (int i = 0; i < str.length(); ++i) { int count = 1; while (i + 1 < str.length() && str[i] == str[i + 1]) { ++count; ++i; } encoded += to_string(count) + str[i]; } cout << encoded; return 0; }


Judgement Protocol: