Symbol
Limits: 2 sec., 512 MiB
This statement was translated automatically from Ukrainian.
Schoolchild, do you know the English alphabet by heart? If not — it’s
okay, we will remind you. Here are the uppercase letters of the
alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ. And here are the
lowercase ones: abcdefghijklmnopqrstuvwxyz.
You are given a single character, which is an uppercase or lowercase
English alphabet letter, a digit (one of 0123456789), or
one of the symbols
!@#$%&*()_-+=[]{};:/?.>,<~.
If the character is a lowercase or uppercase letter, output its ordinal number in the English alphabet.
If the character is a digit, output
digit.If the character is neither a letter nor a digit, output
weird symbol.
Input
A single character is given in one line.
Output
Output the answer depending on the given character.
You should output to the standard output stream (console). Your
output must strictly match the requirements of the problem. No extra
data should be outputted. For example, if you output something like
Enter c: before reading the character, or
Answer for the problem: before outputting the answer, you
will receive the Wrong Answer verdict.
Constraints
The character can be a lowercase or uppercase English alphabet letter, a digit, or a special symbol specified in the statement.
Evaluation consists of the following blocks:
1 point for each sample test from the statement,
10 points: the character is a lowercase letter,
10 points: the character is an uppercase letter,
20 points: the character is a letter,
4 points: the character is a digit,
4 points: the character is a special symbol,
20 points: the character is a letter or a digit,
28 points: no additional constraints.
You will receive the points for a block only if your program passes all tests in that block.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| d | 4 |
| Input (stdin) | Output (stdout) |
|---|---|
| G | 7 |
| Input (stdin) | Output (stdout) |
|---|---|
| 7 | digit |
| Input (stdin) | Output (stdout) |
|---|---|
| @ | weird symbol |
Notes
The character d is a lowercase letter. This letter is
the fourth in the alphabet.
The letter G is the seventh in the alphabet.
The character 7 is a digit.
The character @, which is called "at", snail, puppy, or
doggy, is neither a letter nor a digit.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|