zoukankan      html  css  js  c++  java
  • Lintcode449-Char to Integer-Naive

    Description

    Convert a char to an integer. You can assume the char is in ASCII code (See Definition, so the value of the char should be in 0~255.

    Example

    Example 1:
    	Input:  'a'
    	Output: 97
    	
    	Explanation: 
    	return the number of the char in ASCII.
    
    Example 2:
    	Input:  '%'
    	Output: 37
    	
    	Explanation: 
    	return the number of the char in ASCII.



    注意:

    char 转 int, 打印出来是char对应的ASCII [如 char m = 'a'; int n = (int) m; 输出 n = 97;] 

    代码:

    public int charToInteger(char character) {
            return (int) character;
        }
  • 相关阅读:
    小丑火棘
    凤尾竹
    红王子锦带
    吊兰
    清香木
    鸢尾
    夏鹃
    牡丹吊兰
    美人蕉
    粉花绣线菊
  • 原文地址:https://www.cnblogs.com/Jessiezyr/p/10635556.html
Copyright © 2011-2022 走看看