题意: 将一个整数num变成它的所有十进制位的和,重复操作,直到num的位数为1,返回num。思路: 规律在于随着所给自然数num的递增,结果也是在1~9内循环递增的,那么结果为(num-1)%9+1。注意num为0的情况。1 class Solution {2 public:3 int...
分类:
其他好文 时间:
2015-10-28 12:33:18
阅读次数:
118
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2015-10-27 23:24:52
阅读次数:
184
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2015-10-26 12:08:19
阅读次数:
191
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som...
分类:
其他好文 时间:
2015-10-25 07:28:45
阅读次数:
153
package cn.edu.xidian.sselab;import java.util.ArrayList;/*** title:Add Digits* contents:* Given a non-negative integer num, repeatedly add all its dig...
分类:
其他好文 时间:
2015-10-23 22:46:24
阅读次数:
189
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a...
分类:
其他好文 时间:
2015-10-23 10:12:56
阅读次数:
137
Add DigitsDiscription:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example: Givennum = 38, ....
分类:
其他好文 时间:
2015-10-22 13:59:54
阅读次数:
195
1.EditText输入限制规则在xml:EditText 设置属性android:digits="ABCDE123&*"ABCDE123&*是你的限制规则例如:android:digits="0123456789abc"规则是只能输入英文字母(小写)abc和数字2.EditTex输入的文字为密码形...
分类:
移动开发 时间:
2015-10-19 12:12:22
阅读次数:
1690
Oracle中TO_DATE格式2009-04-14 10:53TO_DATE格式(以时间:2007-11-02 13:45:25为例) Year: yy two digits 两位年 显示值:07 yyy three digits 三位年 显示值:007 yyyy four digits...
分类:
数据库 时间:
2015-10-19 12:07:36
阅读次数:
210