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