mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michele Sessa
f19d5f5341
|
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago |
README.md
getascii
Instructions
Write a program that takes a character as an argument, and displays the correspondent ASCII code followed by a newline.
- If the input is more than one character, return a newline
\n
. - If the number of arguments is less than 1, return a newline
\n
. - If the number of arguments is more than 1, return a newline
\n
. - If the the input is a non ascii character, return a newline
\n
.
Usage
console
$ go run . "W" | cat -e
87$
$
$ go run . "W" "Q" "T" | cat -e
$
$
$ go run . "^" | cat -e
94$
$
$ go run . 7 | cat -e
55$
$
$ go run . a | cat -e
97$
$
$ go run . "Stay Home" | cat -e
$
$ go run .
$