摘要: 写一个复数类,实现基本的运算,目的熟悉封装与数据抽象。类的定义#include #include using namespace std;class Complex{ friend ostream & operator 0) os first = rhs.first; t... 阅读全文
posted @ 2015-11-01 14:00 dylqt 阅读(1951) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-11-01 09:43 dylqt 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 v2) return 1; else if(v2 > v1) ... 阅读全文
posted @ 2015-10-31 19:31 dylqt 阅读(145) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off ... 阅读全文
posted @ 2015-10-30 16:26 dylqt 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the c... 阅读全文
posted @ 2015-10-30 16:24 dylqt 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.class Solution {public: string longestCommonPrefix(vector& st... 阅读全文
posted @ 2015-10-30 09:05 dylqt 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文
posted @ 2015-10-29 18:49 dylqt 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are s... 阅读全文
posted @ 2015-10-29 16:42 dylqt 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... 阅读全文
posted @ 2015-10-29 13:41 dylqt 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 –> AB class Solution... 阅读全文
posted @ 2015-10-29 09:36 dylqt 阅读(129) 评论(0) 推荐(0) 编辑