![]() |
.. (לתיקייה המכילה) | |
Can we use functions or arrays? | |
No, you can only use the material from tutorials 1-4. |
In Question #1: according to the instructions each printed line should end with a line break, but in the given output for question 1 some lines don't end this way. Is this correct? | |
The string describing the required input, and the input itself should appear on the same line. You should print these lines without a ‘\n’ at the end, but with a space instead. Only the lines which do not describe the required input should end with ‘\n’ (including the last line). |
In Question #2: which characters should be ignored? | |
You should ignore tabs, spaces and line breaks. In order to do so, you may use scanf with a space before ‘%c’ - scanf(“ %c”). A detailed explanation can be found in Tutorial 4. |
In Question #2: can we assume that the given number for the width of the house is an integer? | |
You can assume there is a valid number (odd and greater than one) before the first non-digit character in the input. For example the input: 3.5 is valid (the width is 3, and the chars are ‘.’ and ‘5’). |
In Question #2: when printing the roof - do we have to print spaces after the last character of the roof to match the given width? | |
No, the last printed character in each line of the roof should be the roof’s character (and not space). |
In Question #2: In the example, there are two spaces at the top line of the roof. Is this correct? | |
Each string describing an input should end with a space. In the example, one space comes from the line: “Enter two chars: “ and the other one from printing the roof. |
In Question #3: after reading the second number - do we need to stop decrypting (until reading the next number) or continue to decrypt with the new number as the offset? | |
When you detect a number in the input, you should use it as the new offset and continue the decryption. |