| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 81249 | sh25_zhuwy | 字符串p型编码 | C++ | 通过 | 0 MS | 248 KB | 410 | 2026-01-04 15:43:15 |
#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; }