Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #ifdef _MSC_VER
- std::fstream cin, cout;
- void apri() {
- cin = std::fstream("input.txt");
- cout = std::fstream("output.txt");
- if ((!cin) || (!cout)) {
- printf("Non ho copiato i file!");
- exit(0);
- }
- }
- void chiudi() {
- cin.close();
- cout.close();
- }
- #endif
- #ifndef _MSC_VER
- using namespace std;
- #endif
- int main() {
- #ifdef _MSC_VER
- apri();
- #endif
- //usa tranquillamente cin e cout
- #ifdef _MSC_VER
- chiudi();
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment