描述

反转一个只有3位数的整数。

	你可以假设输入一定是一个只有三位数的整数,这个整数大于等于100,小于1000。
  • [ ] 您在真实的面试中是否遇到过这个题?

样例

	123 反转之后是 321。
900 反转之后是 9。
class Solution{
/**
* @param number: A 3-digit number.
* @return: Reversed number.
*/
public int reverseInteger(int number) {
// write your code here
return (number%10)*100+(number/10)%10*10+number/100;
}
}

37_Reverse3_digit_Integer的更多相关文章

随机推荐

  1. 五.ssh远程管理服务

    01. 远程管理服务知识介绍 1) SSH远程登录服务介绍说明 SSH是Secure Shell Protocol的简写,由 IETF 网络工作小组(Network Working Group)制定: ...

  2. ZenMap扫描笔记

    1.软件界面如下,ZenMap 扫描工具是kali linu中对WEB渗透扫描的一款工具

  3. 波哥博客Url

    http://www.cnblogs.com/whatlonelytear/

  4. Python属性(@property)

    创建用于计算机的属性 在Python中,可以通过@property(装饰器)将一个方法转换为属性,从而实现用于计算的属性.将方法转换为属性后,可以直接通过方法名来访问方法,而不需要再添加一对小括号&q ...

  5. selenium 无法启动IE

    解决办法是IE选项设置的安全页中,4个区域的启用保护模式的勾选都去掉(或都勾上)

  6. 彻头彻尾理解 LinkedHashMap

    HashMap和双向链表合二为一即是LinkedHashMap.所谓LinkedHashMap,其落脚点在HashMap,因此更准确地说,它是一个将所有Entry节点链入一个双向链表的HashMap. ...

  7. 该问题是需要导包!!!需要pom中添加依赖The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    <!-- https://mvnrepository.com/artifact/org.apache.taglibs/taglibs-standard-impl --><depend ...

  8. 类和JSP关系

    404的原因.除了路径问题,还有文件放置位置.比如如果文件在web-inf下面.浏览器是访问不到的

  9. 上手TensorFlow

    tensorflow中softmax_cross_entropy和sparse_softmax_cross_entropy的区别 都是softmax cross entropy损失函数,区别在于lab ...

  10. base | AtomicIntegerT类

    1. 原子自增操作 type __sync_fetch_and_add (type *ptr, type value) 2. 原子比较和交换(设置)操作 type __sync_val_compare ...