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

怎会wa?

Posted by gzw_02 at 2008-07-07 10:30:30 on Problem 3438 and last updated at 2008-07-07 10:44:32
# include <stdio.h>
# include <string.h>
char seq[1001];

int main(){
      int i,n,len;
	  char pre;
	  scanf("%d",&n);
	  while(n--){
       scanf("%s",seq);
	   len=strlen(seq);
	   pre=0;
	   for(i=1;i<=len;i++){
		  if(seq[pre]!=seq[i]){
	           printf("%d%c",i-pre,seq[pre]);
	           pre=i;
		   }
	   }
	   putchar('\n');
	  }
	  	return 1;
	}

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