Untitled

mail@pastecode.io avatar
unknown
c_cpp
a month ago
437 B
2
Indexable
Never
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
    ofstream file( "dane.txt", ios::out );

    if (file.is_open())
    {
        for (int i = 1; i <= 100; ++i)
        {
            file << i << ", ";
            //file.flush();
        }
    }
    else
    {
        cout << "Dostep do pliku zostal zabroniony!" << endl;
    }

    file.close();

    return 0;
}
Leave a Comment