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.
38 lines
1.8 KiB
38 lines
1.8 KiB
6 years ago
|
## Cat
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
|
Write a program that does the same thing as the system's `cat` command-line.
|
||
|
|
||
|
- You don't have to handle options.
|
||
|
|
||
6 years ago
|
- But if just call the program with out arguments it should take a input and print it back
|
||
6 years ago
|
|
||
|
- In the program folder create two files named `quest8.txt` and `quest8T.txt`.
|
||
|
|
||
|
- Copy to the `quest8.txt` file this :
|
||
|
|
||
6 years ago
|
- "Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
|
||
6 years ago
|
|
||
6 years ago
|
- Copy to the `quest8T.txt` file this :
|
||
|
|
||
|
- "Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."
|
||
6 years ago
|
|
||
|
- In case of error it should print the error.
|
||
|
|
||
6 years ago
|
### Output:
|
||
6 years ago
|
|
||
|
```console
|
||
|
student@ubuntu:~/student/test$ go build
|
||
|
student@ubuntu:~/student/test$ ./test
|
||
|
Hello
|
||
|
Hello
|
||
|
student@ubuntu:~/student/test$ ./test quest8.txt
|
||
|
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
|
||
|
student@ubuntu:~/student/test$ ./test quest8.txt quest8T.txt
|
||
|
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
|
||
|
|
||
|
"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."
|
||
|
|
||
|
```
|