Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

funny_behradm's blog

By funny_behradm, history, 4 weeks ago, In English,

Hello, Codeforces! I'm new to far manager and I want to create a template for my cpp files, Any Ideas?

Update: Here is a simple python3 script for making a template file, then you can edit sol.cpp and start coding!

template = """#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define F first
#define S second
#define pb push_back
#define pii pair<int, int>
#define debug(x) cerr << x << '\\n'

int main()
{
\tios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
\tcout.precision(6);
\tcout << fixed;
\t//freopen("input.txt", "r", stdin);
\t//freopen("output.txt", "w", stdout);
\treturn 0;
}
"""
f = open("sol.cpp", "w")
f.write(template)
f.close()
 
 
 
 
  • Vote: I like it
  • +8
  • Vote: I do not like it

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Write a script to generate the a file with your template included, after that use Far Manager to edit. Come on, it’s not hard.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I have created my own c++ template, but I am unable to add the date and time when the respective .cpp file is created. My .cpp file template looks like :

/**
*	Author:  Piyush Rajendra Chaudhari
*	created: 
**/
#include <bits/stdc++.h>

using namespace std;

int main() {


  return 0;
}

I have also added plugins like Date and Time, True Template. Here True Template plugin as so many templates but there is no proper documentation how to create our own graph, tree classs template and how to import them?LanceTheDragonTrainer if you answer my above queries, will be a great help...

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

You can also use macros. Press ctrl+shift+"." to record macros

  • »
    »
    4 weeks ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Thank your for reply dear. when I implement Ctrl+Shift+. it asks me to define desired key for a macro... I didn't get the meaning? Please would you elaborate ? And how to import our own written template class for tree and forest?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by funny_behradm (previous revision, new revision, compare).