| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
484ac 848submit mark#include <stdio.h>
#include <string.h>
int main() {
int n;
scanf("%d",&n);
while(n--){
char s[2333];
scanf("%s",s);
int l=strlen(s);
char c=s[0];
int gs=1;
for(int i=1;i<l;i++){
if(s[i]!=c){
printf("%d%c",gs,c);
c=s[i];
gs=1;
}
else{
gs++;
}
}
printf("%d%c\n",gs,c);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator