forked from root/public
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.
25 lines
687 B
25 lines
687 B
5 years ago
|
## printhex
|
||
|
|
||
|
### Instructions
|
||
|
|
||
![]()
5 years ago
|
Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 (with lowercase letters) followed by a newline (`'\n'`).
|
||
5 years ago
|
|
||
![]()
4 years ago
|
- If the number of arguments is different from 1, the program displays nothing.
|
||
5 years ago
|
- Error cases have to be handled as shown in the example below.
|
||
5 years ago
|
|
||
![]()
5 years ago
|
### Usage
|
||
5 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
![]()
4 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test 10
|
||
5 years ago
|
a
|
||
![]()
4 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test 255
|
||
5 years ago
|
ff
|
||
![]()
4 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test 5156454
|
||
5 years ago
|
4eae66
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test "123 132 1" | cat -e
|
||
![]()
4 years ago
|
ERROR$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
![]()
5 years ago
|
```
|