Thanks Gassa for help. The working variant is such:
#define file "taskname"
#ifdef ONLINE_JUDGE
#define in \
//file name in task
freopen(file".in", "r", stdin); \
freopen(file".out", "w", stdout);
#else
#define in \
//your file if you use files as input
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
int main()
{
in;
}
It will make your code for I/O shorter.
At least you can do
Thanks!!! It's exactly what I wanted!