You may choose to write your code in the matlab editor or a standard text editor or in the contest screen. To launch the matlab and its editor, type
To write code, in the contest window, select your chosen language from the drop down menu at the top right side of the screen. Type your code into the box (ignore the Python 2 code it automatically provides).
Enter test input such as the provided sample input into the box on the mid right side of the screen. Click on the test button to compile and run your code using the test input. You will see results appear in the bottom right box.
To submit code for judging, click on the submit button. Feedback will appear in the bottom right box.
This is optional but can be done on the campus Linux system. To run while reading input from the prompt, run your programs on the terminal command line as follows:
input is the name of a file containing your input. The < redirects the contents of the input file into the python program as if you were typing them at the prompt. It is not doing file I/O.
When you run a Matlab program, you will see the output printed in the terminal window. You will also see a Matlab splash screen. You should not end up at a Matlab prompt or in the Matlab GUI unless there are bugs in your program.
% Read in input until you see a 0 and print the input followed by the sum. i = input('', 's'); sum = 0; while eval(i) ~= 0 sum = sum + eval(i); i = input('', 's'); end disp(num2str(sum));Note: I used num2str because printed numbers insisted on indenting and strings did not.