Encoding The Diary

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1289    Accepted Submission(s): 757

Problem Description
You know many girls likes writing diaries,of course they have some secrets don’t want others to know.So this time, they asked you to encoding the diary.
The rule is :
Give you a string. Such as “ARE YOU AC?”
Firstly , delete all spaces in this string.
You will get “AREYOUAC?”
String AREYOUAC?
Index 123456789
Secondly,print the characters who’s index are the multiple of 3.
Thirdly, print the characters who’s index are the multiple of 2.If it has been printed,just ignore it .
At last,print the characters that have not been printed.
 
Input
Each case will contain a string in one line.You may suppose the length of the string will not exceed 200.
 
Output
For each case, output the encoded string in one line.
 
Sample Input
ARE YOU AC?
 
Sample Output
EU?RYCAOA
 #include<stdio.h>
#include<string.h>
int main()
{
char str1[],str2[];
int i,k;
while(gets(str1))
{
k=;
for(i=;str1[i]!='\0';i++)
{
if(str1[i]!=' ')
str2[k++]=str1[i];
}
str2[k]='\0'; for(i=;i<k;i++)
{
if(i%==)
{
printf("%c",str2[i]);
str2[i]='';
}
}
for(i=;i<k;i++)
{
if(i%==&&str2[i]!='')
{
printf("%c",str2[i]);
str2[i]='';
}
}
for(i=;i<k;i++)
if(str2[i]!='')
printf("%c",str2[i]);
printf("\n");
}
return ;
}
 

HDU- 2265 Encoding The Diary的更多相关文章

  1. HDU 1020 Encoding POJ 3438 Look and Say

    Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  2. HDU 1020 Encoding 模拟

    Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  3. HDU 1020 Encoding【连续的计数器重置】

    Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  4. hdu 1020 Encoding

    Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description Given a ...

  5. A - Character Encoding HDU - 6397 - 方程整数解-容斥原理

    A - Character Encoding HDU - 6397 思路 : 隔板法就是在n个元素间的(n-1)个空中插入k-1个板,可以把n个元素分成k组的方法 普通隔板法 求方程 x+y+z=10 ...

  6. Encoding 分类: HDU 2015-06-25 21:56 9人阅读 评论(0) 收藏

    Encoding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...

  7. 2道acm编程题(2014):1.编写一个浏览器输入输出(hdu acm1088);2.encoding(hdu1020)

    //1088(参考博客:http://blog.csdn.net/libin56842/article/details/8950688)//1.编写一个浏览器输入输出(hdu acm1088)://思 ...

  8. hdu Encoding

    Encoding Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Subm ...

  9. HDU 1020:Encoding

    pid=1020">Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Ja ...

随机推荐

  1. O-C相关-09-id 类型与应用

    09-id 类型与应用 1, 使用 NSObject 访问子类对象方法 代码在编辑的时候, Xcode 会实时检查语法情况. 如果调用某个对象的方法, 在声明中没有该方法的声明, 那么就会报错. 但是 ...

  2. Java 编译解释

    JDK提供的主要开发工具有:编译程序,解释执行程序.调试程序.Applet执行程序.文档管理程序.包管理程序等. 1.编译程序:javac.exe,对应的javac命令将Java源程序转换为字节码. ...

  3. Ubuntu下gcc及g++环境配置

    直接在命令行中输入以下命令即可. sudo apt-get install build-essential 安装完成后输入 gcc 和 g++ 进行确认.

  4. Python:如何得到Popen的输出?

    from:http://www.cnblogs.com/bluescorpio/archive/2010/05/04/1727020.html 最近在用subprocess中的Popen做个磁盘监控小 ...

  5. javascript 对象的创建,引用,释放,删除方法

    1.用函数构造 A.声明时同时设置属性和方法 function func(){  this.name = "myname";  this.say = function(){aler ...

  6. Javascript自执行匿名函数(function() { })()的原理浅析

    匿名函数就是没有函数名的函数.这篇文章主要介绍了Javascript自执行匿名函数(function() { })()的原理浅析的相关资料,需要的朋友可以参考下 函数是JavaScript中最灵活的一 ...

  7. HHVM简介(译)

    原文链接:http://coderoncode.com/2013/07/24/introduction-hhvm.html “HHVM(HIpHop Virtual Machina)把PHP代码转换成 ...

  8. TDirectory.Delete 创建删除目录简单示例

    使用函数: 1.System.IOUtils.TDirectory.CreateDirectory//创建目录 2.System.IOUtils.TDirectory.Exists        // ...

  9. Delphi实用小function

    Write Log // strLog : the log content need write to log file; // strFile: the compliete file path(in ...

  10. Polygon Table - Google Chrome

    Polygon table by Pedro Amaro Santos Lisboa, Portugal posted at http://forums.cgsociety.org/showthrea ...