Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
38160 | jiabokai | 字符串p型编码 | C++ | 通过 | 0 MS | 248 KB | 263 | 2024-01-25 15:14:54 |
#include<iostream> #include<cstdio> #include<cstring> using namespace std; char s[1000]; int t=1,l,i; int main() { gets(s); l=strlen(s); for(i=0;i<l;++i){ if(s[i]==s[i+1]){ t++; }else{ cout<<t<<s[i]; t=1; } } return 0; }