博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zoj 2478 Encoding
阅读量:4036 次
发布时间:2019-05-24

本文共 887 字,大约阅读时间需要 2 分钟。

1、

2、题目:

Encoding

           


           

               
Time Limit: 2 Seconds                                   
Memory Limit: 65536 KB                           

           


           

Given a string containing only 'A' - 'Z', we could encode it using the following   method:

1. Each sub-string containing k same characters should be encoded to "kX"   where "X" is the only character in this sub-string.

2. If the length of the sub-string is 1, '1' should be ignored.

  Input

The first line contains an integer N (1 <= N <= 100) which indicates   the number of test cases. The next N lines contain N strings. Each string consists   of only 'A' - 'Z' and the length is less than 100.

  Output

For each test case, output the encoded string in a line.

  Sample Input

2

  ABC
  ABBCCC

  Sample Output

ABC

  A2B3C

 

#include
#include
#include
using namespace std;char str[110];int main(){ int t; scanf("%d",&t); while(t--) { scanf("%s",str); int len=strlen(str),j; for(int i=0;i

转载地址:http://heddi.baihongyu.com/

你可能感兴趣的文章
[关注大学生]李开复给中国计算机系大学生的7点建议
查看>>
[关注大学生]大学毕业生择业:是当"鸡头"还是"凤尾"?
查看>>
[茶余饭后]10大毕业生必听得歌曲
查看>>
gdb调试命令的三种调试方式和简单命令介绍
查看>>
C++程序员的几种境界
查看>>
VC++ MFC SQL ADO数据库访问技术使用的基本步骤及方法
查看>>
VUE-Vue.js之$refs,父组件访问、修改子组件中 的数据
查看>>
Vue-子组件改变父级组件的信息
查看>>
Python自动化之pytest常用插件
查看>>
Python自动化之pytest框架使用详解
查看>>
【正则表达式】以个人的理解帮助大家认识正则表达式
查看>>
性能调优之iostat命令详解
查看>>
性能调优之iftop命令详解
查看>>
非关系型数据库(nosql)介绍
查看>>
移动端自动化测试-Windows-Android-Appium环境搭建
查看>>
Xpath使用方法
查看>>
移动端自动化测试-Mac-IOS-Appium环境搭建
查看>>
Selenium之前世今生
查看>>
Selenium-WebDriverApi接口详解
查看>>
Selenium-ActionChains Api接口详解
查看>>