第一次见到这个题目,我觉得自己没学到java,太浅了,其实这个问题没有考synchronized关键字,只是考什么是对象?1.在java编程思想的第二章有一句话;一切都是对象,很可惜int,char 等不是的,虽然他们有他们的包装类,但是java还是保留了int 这些好用的原子类型,对于synchr...
分类:
编程语言 时间:
2014-07-06 17:04:51
阅读次数:
409
Divide two integers without using multiplication, division and mod operator.思路:不能使用乘法除法以及取模运算来计算两个数相除。主要做法就是,将因子不断乘2(向左移位即可实现),同时结果从1不断移位加倍,等到除数大于被除数一...
分类:
其他好文 时间:
2014-07-06 15:34:24
阅读次数:
197
作者:iamlaosong
1、问题提出
编程中发现一个问题,系统总是提示编译错误,ByRef 参数类型不符,
可实际上参数定义没问题,原因在哪儿呢?
2、问题环境
假定函数定义如下:
Function get_kind(addr As String) As Integer
......
End Function
调用过程:
Sub check_addres...
分类:
其他好文 时间:
2014-07-06 10:45:44
阅读次数:
399
;; Fermat's Little Theorem:
;; If N is a prime number and A is any positive integer less
;; than N, then A raised to the N-th power is congruent to A modulo N
;; Two numbers are said to be congruent...
分类:
其他好文 时间:
2014-07-06 09:05:22
阅读次数:
158
Problem 1607 Greedy division...
分类:
其他好文 时间:
2014-07-06 00:45:19
阅读次数:
344
Divide two integers without using multiplication, division and mod operator.不用乘、除、求余操作,返回两整数相除的结果,结果也是整数。假设除数是2,相除的商就是被除数二进制表示向右移动一位。假设被除数是a,除数是b,因为不知...
分类:
其他好文 时间:
2014-07-05 20:37:18
阅读次数:
193
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-07-05 18:37:04
阅读次数:
188
Determine whether an integer is a palindrome. Do this without extra space.
Some
hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to string...
分类:
其他好文 时间:
2014-07-05 10:44:29
阅读次数:
227
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of...
分类:
其他好文 时间:
2014-07-04 07:35:58
阅读次数:
215
In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.
Input and Output
The input begins with a single positive integer on a line by i...
分类:
其他好文 时间:
2014-07-03 17:15:14
阅读次数:
204