알고리즘(C++)/백준 알고리즘

11654번 : 아스키코드

개발하는꼬물이 2018. 5. 3. 17:04

1. 문제 요약

   알파벳 소문자, 대문자, 숫자 0 - 9  중 하나가 주어졌을 때, 주어진 글자의 아스키코드 값을 출력하시오.

   (입력은 1개의 문자만 가능)


2. 예제 입력

A
0
a


3. 예제 출력

65
48
97


4. 코드 

#include <iostream>
using namespace std;

int main()
{
	char input;
	int iInput;

	cin >> input;
	
	iInput = (int)input;
	cout << iInput << endl;

	return 0;
}