Untitled

 avatar
unknown
c_cpp
a year ago
437 B
4
Indexable
#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;
}
Editor is loading...
Leave a Comment