hdu1020
来源:互联网 发布:java复试 编辑:程序博客网 时间:2024/06/05 16:10
点击打开链接
水题
注释:用一个变量k统计每个字母出现的次数,当该子母出现的次数统计完时,若k>1,则输出k和字母。
#include <iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int n;
char s[10005];
cin>>n;
while(n--)
{
cin>>s;
int lenth=strlen(s),k=1;
char temp=s[0];
for(int i=1;i<lenth+1;i++)
{
if(temp==s[i])
k++;
else
{
if(k!=1)
printf("%d",k);
printf("%c",temp);
temp=s[i];
k=1;
}
}
printf("\n");
}
return 0;
}
0 0
- hdu1020
- hdu1020
- hdu1020
- HDU1020
- hdu1020
- hdu1020
- HDU1020
- HDU1020
- HDU1020
- HDU1020 Encoding
- hdu1020 Encoding
- HDU1020:Encoding
- HDU1020--- 编码
- Encoding(HDU1020)
- HDU1020 Encoding
- HDU1020 Encoding
- hdu1020 - Encoding
- hdu1020 Encoding
- 权限系统设计
- RAC挂载共享磁盘组
- jquery常用事件
- mysql处理海量数据时的一些优化查询速度方法
- LoadRunner使用笔记
- hdu1020
- 启动rsync服务的脚本并能用chkconfig管理
- 父类方法中使用this,那么这个this指的是谁?
- DataNode数据处理中心DataXceiver
- 国外那些优秀的 Drupal 教程博客
- 高质量C++/C编程指南(一)
- WC2016随记
- CSDN ios app体验怎么这么差啊,求推荐好用的app
- python packaging