Here are three simple programming exercises. Your objective is to write the shortest possible programs to solve each task. At the end of the session, sample solutions will be revealed. If you want to compare, try to use the same languages!
- You may use any language.
- Each submission is expected to be a complete program that reads from standard input and writes to standard output.
- Your output has to match the expected output exactly, aside from slight differences in trailing whitespace at the end of the output.
- Programs may terminate with error, as long as error messages are not written to standard output.
Your program will read the test cases from standard input and print directly to standard output. Sample test cases can be found in each problem's folder. To verify your output, you may diff it against the sample output.
E.g. diff <(python test.py < 1.in) 1.out