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. OpenCV(6)-腐蚀和膨胀

    腐蚀和膨胀属于形态学操作. 腐蚀和膨胀 腐蚀是指:将卷积核B滑过图像A,找出卷积核区域内最小像素值作为锚点像素值.这一操作可以扩大低像素值区域. 膨胀是指:将卷积核B滑过图像A,找出卷积核区域内最大像 ...

  2. 绑定本地Service并与之通信

    绑定Service需要调用 public boolean bindService (Intent service, ServiceConnection conn, int flags): 传入一个Se ...

  3. 九度OJ 1451 不容易系列之一 -- 动态规划

    题目地址:http://ac.jobdu.com/problem.php?pid=1451 题目描述: 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若 ...

  4. 【搭建开发环境】在 Windows XP 中参与开源项目,搭建 git 和 cygwin 开发环境

    引言 只有一台 Windows XP 家用机,却想在诸如 Git@OSC 之类的开源社区参与开发,本文提供一个入门级的开发环境搭建指引. 涉及工具:Eclipse,EGit,Cygwin. 欢迎来到 ...

  5. 深入了解line-height

    1.定义   行高:两行文字baseline(基线)之间的距离 示意图: 2.为何line-height可以让单行文本垂直居中       其实并没有垂直居中,除非将font-size:0; 3.li ...

  6. CSS定位机制

    CSS中,存在3种定位机制:标准文档流(Normal flow) * 特点:从上到下,从左导游,输出文档内容 * 由块级元素和行级元素组成 浮动(Floats) * 能够实现横向多列布局 * 设置了浮 ...

  7. 诡异的XmlSerializer属性字段Specified

    自动生成代码时,往往会为一个字段假设为 * , 生成另一个bool型字段: *Specified: 如: [Serializable] public class A { [XmlElement] pu ...

  8. node.js操作mongoDB数据库

    链接数据库: var mongo=require("mongodb"); var host="localhost"; var port=mongo.Connec ...

  9. 服务器端启动soket多线程

    方法一: Socket socket=null try{ ServerSocket serversocket=nwe ServerSocket(8080) while(true){ socket=se ...

  10. (转载)Delphi StringGrid常用属性和常用操作

    Delphi StringGrid常用属性和常用操作 StringGrid组件用于建立显示字符串的网格,与电子表格相似.它可使表格中的字符串和相关对象操作简单化.StringGrid组件提供了许多可控 ...