首页 > 其他 > 详细

hdu1020

时间:2015-09-01 01:36:31      阅读:134      评论:0      收藏:0      [点我收藏+]

大水题,注意看清题意,相同字母在一块

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iterator>
#include<iostream>
#include<algorithm>
#include<set>
using namespace std;

int main()
{
	int num;
	char s[10005];
	cin>>num;
	while(num--)
	{
		cin>>s;
		int t=1;
		for(int i=0;i<strlen(s);i++)
		{
			if(s[i] == s[i+1])
				t++;
			else
			{
				if(t>1)
					cout<<t;
				cout<<s[i];
				t=1;
			}
		}
		cout<<endl;	
	}
	return 0;
}

  

hdu1020

原文:http://www.cnblogs.com/lmqpt/p/4774435.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!