|
|
@ -10,11 +10,11 @@ The program has to be used with three arguments: |
|
|
|
- An operator |
|
|
|
- An operator |
|
|
|
- Another value |
|
|
|
- Another value |
|
|
|
|
|
|
|
|
|
|
|
In case of an invalid entry the programs prints `0`. |
|
|
|
In case of an invalid operator the programs prints `0`. |
|
|
|
|
|
|
|
|
|
|
|
In case of an invalid number of arguments the program prints nothing. |
|
|
|
In case of an invalid number of arguments the program prints nothing. |
|
|
|
|
|
|
|
|
|
|
|
The program has to handle the modulo and division by 0 as shown on the output examples below. |
|
|
|
The program has to handle the modulo and division operations by 0 as shown on the output examples below. |
|
|
|
|
|
|
|
|
|
|
|
`fmt.Print` is authorized. |
|
|
|
`fmt.Print` is authorized. |
|
|
|
|
|
|
|
|
|
|
@ -25,8 +25,8 @@ student@ubuntu:~/piscine/test$ go build doop.go |
|
|
|
student@ubuntu:~/piscine/test$ ./doop |
|
|
|
student@ubuntu:~/piscine/test$ ./doop |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 + 1 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 + 1 |
|
|
|
2 |
|
|
|
2 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop hello + 1 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop hello + 1 | cat -e |
|
|
|
0 |
|
|
|
0$ |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 p 1 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 p 1 |
|
|
|
0 |
|
|
|
0 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 + 1 |
|
|
|
student@ubuntu:~/piscine/test$ ./doop 1 + 1 |
|
|
|