First Exercise
This commit is contained in:
24
Informatik_I/Exercise_1/Task_2/README.md
Normal file
24
Informatik_I/Exercise_1/Task_2/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Task
|
||||
|
||||
_This task is a text-based task but mostly automatically checked. You are required to write your answers into submission.txt by replacing the question marks with the correct solution. Please, do not change the line formating._
|
||||
|
||||
_You can check whether your solution is correct by clicking on the test button._
|
||||
|
||||
Numbers can be provided in various formats in C++. Literals prefixed with `0b` indicate binary encoding. Assume unsigned arithmetics with sufficient numbers of bits, i.e. no overflows. Convert the following binary numbers into decimal numbers (1-4) and decimal numbers to binary (5-8):
|
||||
|
||||
```txt
|
||||
# Lines starting with # are comments. Spaces is ignored.
|
||||
# Lines starting with a whitespace before # will not be a comment.
|
||||
|
||||
# Convert to decimal:
|
||||
0b1 = ?
|
||||
0b10 = ?
|
||||
0b000001 = ?
|
||||
0b101010 = ?
|
||||
|
||||
# Convert to binary:
|
||||
7 = ?
|
||||
11 = ?
|
||||
28 = ?
|
||||
1024 = ?
|
||||
```
|
14
Informatik_I/Exercise_1/Task_2/submission.txt
Normal file
14
Informatik_I/Exercise_1/Task_2/submission.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
# Lines starting with # are comments. Spaces are ignored.
|
||||
# Lines starting with a whitespace before # will not be a comment.
|
||||
|
||||
# Convert to decimal:
|
||||
0b1 = 1
|
||||
0b10 = 2
|
||||
0b000001 = 1
|
||||
0b101010 = 42
|
||||
|
||||
# Convert to binary:
|
||||
7 = 0b111
|
||||
11 = 0b1011
|
||||
28 = 0b11100
|
||||
1024 = 0b10000000000
|
Reference in New Issue
Block a user