标签:while des less contain out following OWIN enc line
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <vector> #include <cmath> #include <queue> #include <deque> #include <cmath> #include <map> using namespace std; typedef long long ll; const double inf=1e20; const int maxn=1e5+10; const int mod=1e9+7; char a[maxn]; char s[maxn]; int num[maxn]; int main(){ int t; scanf("%d",&t); while(t--){ scanf("%s",a); int len=strlen(a); int j=0; s[0]=a[0]; num[0]=1; for(int i=1;i<len;i++){ if(a[i]==s[j])num[j]++; else { s[++j]=a[i]; num[j]=1; } } for(int i=0;i<=j;i++){ if(num[i]!=1){ printf("%d",num[i]); } printf("%c",s[i]); }printf("\n"); } return 0; }
标签:while des less contain out following OWIN enc line
原文地址:https://www.cnblogs.com/wz-archer/p/12405531.html