How to setup the Sublime Text for C++ Competitive Programming

Let's setup the sublime text 


To Install Sublime on ubuntu click on the link - Link


Follow these steps to setup the Sublime Text -

Open your Sublime Text IDE - 

Step 1 - Click on View -> Layout -> Columns 3 (select this)

or directly enter (shift + alt + 3).

you will get like this -



Step 2 - Click on View -> Groups -> Max columns 2 (select this)

Now you will get like this -



Step 3 - Create 3 different files(make sure all 3 files should be in same directory) in all 3 Columns.

Rename files name as code.cpp, input.txt and output.txt.


Step 4 - Type your code in the code.cpp file, write input in input.txt and you will get output in output.txt file.

Write the below code in the starting of the main function of your program.

#ifndef ONLINE_JUDGE

freopen("input.txt", "r", stdin);

freopen("output.txt", "w", stdout);

#endif

like this



Well done, Now it's time to run your program

Step 5 - Save the files and enter (ctrl + shift + b) and select C++ Single File - Run and your program will be run out and you will get output in the output.txt file section.

Like this


Step 6 - To run your program only enter (ctrl + b).

Offers















Reactions

Post a Comment

0 Comments