摘要:
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp... 阅读全文
posted @ 2015-09-08 08:53
茜茜的技术空间
阅读(120)
评论(0)
推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of two.Java code:(两种方法,第二种方法很妙,用到了bit wise )第二种方法解题思路:如果一个整数是2的幂,那么它的二进制形式最高位为1,其余各位为... 阅读全文
posted @ 2015-09-08 08:33
茜茜的技术空间
阅读(158)
评论(0)
推荐(0)
摘要:
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ask... 阅读全文
posted @ 2015-09-08 08:08
茜茜的技术空间
阅读(174)
评论(0)
推荐(0)
摘要:
Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文
posted @ 2015-09-08 04:08
茜茜的技术空间
阅读(208)
评论(0)
推荐(0)
摘要:
Question:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.简单介绍一下罗马数字,摘自维基百科罗马数字共有7个,即I(1)、V(5... 阅读全文
posted @ 2015-09-08 03:19
茜茜的技术空间
阅读(185)
评论(0)
推荐(0)

浙公网安备 33010602011771号