poj3438
字符串水題
?
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std;void work() {string st;cin >> st;int length = st.length();int l = 1;for (int i = 1; i < length; i++){if (st[i] != st[i - 1]){printf("%d%c", l, st[i - 1]);l = 1;}elsel++;}printf("%d%c", l, st[length - 1]);cout << endl; }int main() {//freopen("D:\\t.txt", "r", stdin);int t;scanf("%d", &t);while (t--){work();}return 0; }總結
- 上一篇: 关于 Apache Maven 您不知道
- 下一篇: 我很笨,请带着真心靠近我