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

RE不解 求大牛们!!!!

Posted by xulinxi at 2010-07-22 19:54:25 on Problem 3438
#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:
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