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.
21 lines
539 B
21 lines
539 B
6 years ago
|
## paramcount
|
||
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
Write a program that displays the number of arguments passed to it. This number will be followed by a newline (`'\n'`).
|
||
6 years ago
|
|
||
5 years ago
|
If there is no argument, the program displays `0` followed by a newline.
|
||
6 years ago
|
|
||
5 years ago
|
### Usage
|
||
6 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/paramcount$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/paramcount$ ./paramcount 1 2 3 5 7 24
|
||
6 years ago
|
6
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/paramcount$ ./paramcount 6 12 24 | cat -e
|
||
6 years ago
|
3$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/paramcount$ ./paramcount | cat -e
|
||
6 years ago
|
0$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/paramcount$
|
||
6 years ago
|
```
|