.. (לתיקייה המכילה) | ||
Question 1 - How does the program know when the input ends? | |
The input ends when getchar() returns EOF. Line break ('\n') does NOT indicate the end of the input. |
Question 1 - If we're using getchar and putchar on every keypress, then the input and the output will be mixed together. | |
Give your program the input from a file using redirection. This way, the input and output will not be mixed. (a note about this has been added to the assignment in version 1.01). |
Question 1 - How should we treat characters which were not specified in the exercise? | |
All characters are legal. Characters which have no special function, should be just copied to the output. |
Question 1 - What exactly are the allowed email address formats? | |
You can assume that all email addresses in the text are in the format A@B "A" will not contain special characters, and the only special character "B" can contain is ".". "B" will contain at least one letter between every two dots, and there is no need to check it. You can assume that no word in the text will contain more than one @, and there is no need to check it. To sum up: 1. The following are valid email addresses:
2. You can assume the following will not appear in the text:
|
Question 3 - Is it OK to output the error message after some of the output was already printed? | |
Yes. For example: Please enter string: ddcccca$sss d2c4a1 ERROR |
Question 4 - Is it OK to output the error message after some of the output was already printed? | |
Yes. For example: Please enter string: v2g1t2#d3 vvgtt ERROR |
Question 3 - Can we assume the maximal length of the input is bounded? | |
Yes you can. |
Question 3 - What should be the output for the string "aaaabbaa!"? | |
The output should be "a4b2a2!" |
Question 3 - What happens if the user inserts more than one '!'? | |
Treat the string as a valid string up to the first '!'. Meaning, in the previous example, treat it as if you got "aaabb!". |
Question 4 - Do we have to print the output as in the example in two columns? | |
No, you can print the output in whatever format you prefer, as long as it contains all the requested information. |
Question 2 - Can we use the function "pow()" for the calculations? | |
Yes. |