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.
63 lines
1.7 KiB
63 lines
1.7 KiB
6 years ago
|
## raid3
|
||
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
This raid is based on the `raid1` functions.
|
||
6 years ago
|
|
||
5 years ago
|
Create a program `raid3` that takes a `string` as an argument and displays the name of the matching `raid1` and its dimensions.
|
||
6 years ago
|
|
||
5 years ago
|
- If the argument is not a `raid1` the program should print `Not a Raid function`.
|
||
6 years ago
|
|
||
5 years ago
|
- All answers must end with a newline (`'\n'`).
|
||
5 years ago
|
|
||
5 years ago
|
- If there is more than one `raid1` matches, the program must display them all alphabetically ordered and separated by a `||`.
|
||
5 years ago
|
|
||
|
### Usage
|
||
6 years ago
|
|
||
5 years ago
|
- If it's `raid1a`
|
||
5 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ls -l
|
||
5 years ago
|
-rw-r--r-- 1 student student nov 23 14:30 main.go
|
||
5 years ago
|
-rwxr-xr-x 1 student student nov 23 19:18 raid3
|
||
|
-rwxr-xr-x 1 student student nov 23 19:50 raid1a
|
||
|
-rwxr-xr-x 1 student student nov 23 19:50 raid1b
|
||
|
-rwxr-xr-x 1 student student nov 23 19:50 raid1c
|
||
|
-rwxr-xr-x 1 student student nov 23 19:50 raid1d
|
||
|
-rwxr-xr-x 1 student student nov 23 19:50 raid1e
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1a 3 3 | ./raid3
|
||
5 years ago
|
[raid1a] [3] [3]
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
5 years ago
|
```
|
||
|
|
||
|
- If it's `raidc 1 1` :
|
||
|
|
||
6 years ago
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 1
|
||
5 years ago
|
A
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1d 1 1
|
||
6 years ago
|
A
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 1
|
||
5 years ago
|
A
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 1 | ./raid3
|
||
5 years ago
|
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1]
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
5 years ago
|
```
|
||
|
|
||
|
- If it's `raidc 1 2` :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 2
|
||
6 years ago
|
A
|
||
5 years ago
|
C
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1c 1 2
|
||
6 years ago
|
A
|
||
5 years ago
|
C
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$ ./raid1e 1 2 | ./raid3
|
||
5 years ago
|
[raid1c] [1] [2] || [raid1e] [1] [2]
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/raid3$
|
||
6 years ago
|
```
|