Skip to content

Instantly share code, notes, and snippets.

@paulodiogo
Created December 4, 2020 00:46
Show Gist options
  • Save paulodiogo/35c2e279bdcd4ad60abe4cdfd7a1a1cd to your computer and use it in GitHub Desktop.
Save paulodiogo/35c2e279bdcd4ad60abe4cdfd7a1a1cd to your computer and use it in GitHub Desktop.
Redirect input and output to files
//include
#include <bits/stdc++.h>
//configure
ifstream cin("input.txt");
ofstream cout("output.txt");
//Use cin and cout normally:
cin >> N;
cout << N;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment