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
1 | #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
Problem link
http://noi.openjudge.cn/ch0102/07/
OpenJudge 07:Print ASCII code
Comments