Advertisement
informaticage

Bri bro IO dei File!!

Mar 17th, 2021
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3.  
  4. int main() {
  5.   using namespace std;
  6.   // Input File Stream
  7.   ifstream fin("paperella.txt");
  8.   ofstream fout("anatra.txt");
  9.  
  10.   if(fin.is_open()) {
  11.     cout << "File trovato" << endl;
  12.   } else {
  13.     cout << "File non trovato" << endl;
  14.   }
  15.  
  16.   string a = "";
  17.   fin >> a;
  18.  
  19.   fout << "Anatroccolo zucculello!" << endl << "Cammello di dio";
  20.   cout << "A: " << a << endl;
  21.   return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement