摘要: To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s 阅读全文
posted @ 2018-03-12 18:58 王清河 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, 阅读全文
posted @ 2018-03-12 16:56 王清河 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given 阅读全文
posted @ 2018-03-12 15:06 王清河 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s 阅读全文
posted @ 2018-03-12 12:55 王清河 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t 阅读全文
posted @ 2018-03-12 10:47 王清河 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现一种数字加密方法。首先固定一个加密用正整数A,对任一正整数B,将其每1位数字与A的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对13取余——这里用J代表10、Q代表11、K代表12;对偶数位,用B的数字减去A的数字,若结果为负数,则再加10。这里令个位为第1位。 输入格式: 阅读全文
posted @ 2018-03-12 10:35 王清河 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+- 阅读全文
posted @ 2018-03-11 20:51 王清河 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm". It took him only a min 阅读全文
posted @ 2018-03-11 15:58 王清河 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。 输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。 输出格式:每个测试用例的 阅读全文
posted @ 2018-03-11 14:12 王清河 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 读入一个自然数n,计算其各位数字之和,用汉语拼音写出和的每一位数字。 输入格式:每个测试输入包含1个测试用例,即给出自然数n的值。这里保证n小于10100。 输出格式:在一行内输出n的各位数字之和的每一位,拼音数字间有1 空格,但一行中最后一个拼音数字后没有空格。 输入样例: 12345678909 阅读全文
posted @ 2018-03-11 11:08 王清河 阅读(135) 评论(0) 推荐(0) 编辑