Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- const int n = 5;
- int tablica[n];
- int tmp = 0;
- ifstream liczby("dane.txt");
- if (!liczby)
- {
- cout << "Nie mozna otworzyc pliku";
- getchar();
- return 1;
- }
- while (!liczby.eof())
- liczby >> tablica[tmp++];
- liczby.close();
- for (int i=0; i<tmp; i++)
- cout << "Liczba: " << tablica[i] << endl;
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement