![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
简单编程
HowardLin
这个作者很懒,什么都没留下…
展开
-
判断两个字符串是不是互为anagrams
Description Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The head原创 2016-04-12 10:07:12 · 1787 阅读 · 0 评论 -
Printing numbers in a pyramid pattern(一)
Description Write a program that reads an interger n, then display one of the following patterns. Pattern 1 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6Pattern 2 1 2原创 2016-04-26 09:48:26 · 984 阅读 · 0 评论 -
the number of position
Description Jesse stands in line of n people, but he doesn’t know exactly which position he occupies. He can say that there are no less than A people standing in front of him and no less than B people原创 2016-04-14 10:17:14 · 432 阅读 · 0 评论 -
T-Prime(数学规律)
Description We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we’ll call a positive integer t Т-prime, if t has exactly three distinct posit原创 2016-04-16 18:50:20 · 1551 阅读 · 0 评论 -
将十六进制字符串转换成十进制数字
Write a function that parses a hex number as a string into a decimal integer.The function header is as follows: int parseHex(const char * const hexString) For example, hexString “A5” is 165 (10*16+5=16原创 2016-04-12 09:39:52 · 2927 阅读 · 0 评论 -
求链表中奇数位置上的和
给出一个链表,每个节点有一个数值,你需要返回链表奇数位置的数值之和,位置从1开始计数。例如链表为1->2->4->5->6你需要返回11include include using namespace std;struct ListNode{ int val; ListNode *next; ListNode():val(0), next(NULL){}; Li原创 2016-04-18 20:37:03 · 816 阅读 · 0 评论 -
Yaroslav and Permutations
Description Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two array elements. Now Yaroslav is wondering if he can obtain an array where any two neighboring el原创 2016-04-25 01:36:29 · 435 阅读 · 0 评论