#include <fstream>
using namespace std;

int main() {
    ofstream flux;                                 // Déclaration
    flux.open("pi.txt");                           // Ouverture
    flux << "Pi vaut à peu près " << 3.14 << endl; // Écriture
    flux.close();                                  // Fermeture
}