| ||||||||||
| 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 | |||||||||
RE不解 求大牛们!!!!#include<stdio.h>
#include<string.h>
int main()
{
int n,i,j=1,k;
char a[100]={'\0'};
scanf("%d",&n);
while(n--)
{
i=0;
j=1;
scanf("%s",a);
k=strlen(a);
while(1)
{
if(a[i]==a[i+1])
{
while(1)
{
j++;
i++;
if(a[i]!=a[i+1]&&a[i]!='\0')
break;
}
}
printf("%d%d",j,a[i]-'0');
i=i+1;
j=1;
if(i==k)
break;
}
printf("\n");
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator