forked from root/public
Compare commits
1 Commits
master
...
1273-print
Author | SHA1 | Date |
---|---|---|
estlop | be7ee1ffc4 | 2 years ago |
3 changed files with 20 additions and 29 deletions
@ -1,25 +0,0 @@
|
||||
## get-area |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that takes a positive number as radius and prints the area of a circle. |
||||
- The area of the circle is `3.14` times the radius squared. |
||||
- Only positive numbers will be accepted, otherwise print `Error` followed by (`'\n'`) |
||||
- If the number of arguments is not `1` print (`'\n'`) |
||||
- The output must be an integer. |
||||
|
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
$ go run . | cat -e |
||||
$ |
||||
$ go run . 10 | cat -e |
||||
314$ |
||||
$ go run . 4 | cat -e |
||||
50$ |
||||
$ go run . -10 | cat -e |
||||
Error$ |
||||
$ go run . "Hello World!" | cat -e |
||||
Error$ |
||||
``` |
@ -0,0 +1,15 @@
|
||||
## printevenarguments |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that receives some arguments from the command line and prints the ones with an even index followed by a new line. If the number of even arguments is 0, print a new line. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
$ go run . first second third | cat -e |
||||
second$ |
||||
$ go run . a b c d| cat -e |
||||
b$ |
||||
d$ |
||||
``` |
Loading…
Reference in new issue