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:怎会wa?

Posted by gzw_02 at 2008-07-07 11:29:49 on Problem 3438
In Reply To:怎会wa? Posted by:gzw_02 at 2008-07-07 10:30:30
> # 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;
> 	}

char pre ---> int pre

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