Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <stdlib.h>
- #include <time.h>
- using namespace std;
- void GeneruojaIrSpausdina(int kiek);
- int main() {
- setlocale(LC_ALL, "Lithuanian");
- int kiek;
- cout << "Kiek eilučių generuoti? ";
- cin >> kiek;
- cout << endl;
- GeneruojaIrSpausdina(kiek);
- system("pause");
- return 0;
- }
- void GeneruojaIrSpausdina(int kiek) {
- ofstream fout("Skaiciai.txt");
- int a = 11111;
- for (int i = 0; i < kiek && a < 100000; i++)
- {
- fout << a << endl;
- a++;
- }
- cout << "Skaičiai išvesti į failą Skaiciai.txt\n\n\n";
- fout.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement