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

484ac 848submit mark

Posted by KatrineYang at 2016-11-07 00:41:10 on Problem 3438
#include <stdio.h>
#include <string.h>
int main() {
	int n;
	scanf("%d",&n);
	while(n--){
		char s[2333];
		scanf("%s",s);
		int l=strlen(s);
		char c=s[0];
		int gs=1;
		for(int i=1;i<l;i++){
			if(s[i]!=c){
				printf("%d%c",gs,c);
				c=s[i];
				gs=1;
			}
			else{
				gs++;
			}
		}
		printf("%d%c\n",gs,c);
	}
	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