Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

1A!!!!

Posted by wocha at 2012-07-13 13:32:47 on Problem 3438
#include<stdio.h>
#include<string.h>
int main()
{
  int m,n,i,j,k,l;
  while(~scanf("%d",&n))
 {
        while(n--)
        {
            char str[6666];
            scanf("%s",str);
            l=strlen(str);
           for(i=0;i<l;i++)
         {
                int cnt=0;
                for(j=i;j<l;j++)
                {
                    if(str[i]!=str[j])
                    {
                        break;
                    }
                    else
                    cnt++;
                }
                printf("%d%c",cnt,str[i]);
                i=j-1;
        }
            printf("\n");
        }
        
}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator