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. JAVA中实现百分比

    import java.text.NumberFormat; public class TeachYou { public static void main(String[] args) { //这里 ...

  2. SGU 218.Unstable Systems

    题意: 有n(n<500)台机器,和500个程序.不同的程序在不同的机器上运行有着不同的不稳定度s[i][j].求最小的最大稳定度及其方案. Solution: 比较经典的二分图模型. 建图很简 ...

  3. c++primer复习(一)

    1 const对象默认为文件的局部变量(P50) a.cpp ; b.cpp extern int a;//undefined reference to "a" a.cpp ; b ...

  4. erlang 里的if 和 case

    case Expression of Pattern1 [when Guard1] -> Expr_seq1; Pattern2 [when Guard2] -> Expr_seq2; … ...

  5. leetcode problem 6 ZigZag Conversion

    The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like ...

  6. Linq知识大全

    select的源码public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable< ...

  7. Day9 网络编程

    OSI(Open System Interconnect),即开放式系统互联. ISO(International Standards Organization)国际标准化组织 OSI七层模型: TC ...

  8. Win7 + VS2015 + CMake3.6.1-GUI编译库

    CMake生成Unicode版本VC工程 Just add this line in your top CMakeLists.txt file:     add_definitions(-DUNICO ...

  9. NDK_ROOT找不到的解决方法 MACOS

    只要在Eclipse上进行配置就行了,看图说话  

  10. asp.net mvc将html编译

    从数据库查询出来的值,如果包含html标签并且通过MVC绑定页面的话,那么他会通过浏览器编译为字符串显示,所以我们有得在从新的转一次: HtmlString hh = new HtmlString(M ...