OpenJudge 07:Print ASCII code

Description

Enter a visible character other than a space (guaranteed to be read in by the format specifier %c in the function scanf), and output its ASCII code.

Input

A visible character other than a space.

Output

A decimal integer, the ASCII code of the character.

Input sample

A

Output sample

65

Answer

C++
1
2
3
4
5
6
7
8
9
10
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
char c;
scanf("%c",&c);
printf("%d",int(c));
return 0;
}

Result

Used memory: 200kB
Run time: 0ms
Language:G++
Submit time:2021-04-20 10:23:05

http://noi.openjudge.cn/ch0102/07/

OpenJudge 07:Print ASCII code

https://blog.tsinbei.com/en/archives/541/

Author
Hsukqi Lee
Posted on

2022-07-03

Edited on

2022-07-28

Licensed under

CC BY-NC-ND 4.0

# Programing  Cpp  OpenJudge  NOI  NOIP

Comments

Name
Mail
Site
None yet