Write an algorithm to determine if a number is "happy".
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares o...
分类:
移动开发 时间:
2015-04-29 19:56:35
阅读次数:
162
网址:https://leetcode.com/problems/reverse-integer/
题意:
反转数字,正负不变.
分析:
思路显而易见,
重点在有些刁钻的输入输出上.
解法:
因为无视正负,又要用到mod.
自然想到abs...
不过abs对于int并不完全适用.
使用前,判断一下是不是INT_MIN或Integer.MIN_VALUE
我又不想记住这个正负,...
分类:
其他好文 时间:
2015-04-29 19:49:22
阅读次数:
129
Another LCISTime Limit: 1000msMemory Limit: 65536KBThis problem will be judged onUESTC. Original ID:142564-bit integer IO format:%lld Java class name:...
分类:
其他好文 时间:
2015-04-29 18:57:19
阅读次数:
191
Twinkling lights IIITime Limit: 8000msMemory Limit: 131072KBThis problem will be judged onFZU. Original ID:196864-bit integer IO format:%I64d Java cla...
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...
分类:
其他好文 时间:
2015-04-29 16:37:16
阅读次数:
153
-- Created on 2015/4/29 by MENGHU DECLARE -- Local variables here I INTEGER; BEGIN FOR OPEN_DATA IN (SELECT * FROM SYS_DEPT_ACCOUNTING SDA WHERE SD...
分类:
数据库 时间:
2015-04-29 16:35:59
阅读次数:
160
DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 a...
分类:
其他好文 时间:
2015-04-29 14:51:45
阅读次数:
99
规则1:以括号组成表达式,左右括号“(”与“)”一定要成对、相对称,内部的字符串双引号““”与”“””也要成对。规则2:表达式格式:(函数名运算符运算符运算符)*操作函数包括功能函数与自定义函数。*运算符(自变量)包括: ◆整数(Integer),如8,-17,500,,9999; ◆实数(R...
分类:
其他好文 时间:
2015-04-29 09:47:05
阅读次数:
144
2015年4月28号晚,珠海。晴、Java 的基本数据类型有整型(integer),浮点型(float),布尔型(boolean),字符型(char)1.整型(integer) java最基本的数据类型,使用int表示 范围表示有 short long int byte 1.1 十进制 (生活...
分类:
编程语言 时间:
2015-04-29 00:32:27
阅读次数:
143
题目:
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 s...
分类:
其他好文 时间:
2015-04-28 22:53:01
阅读次数:
177