Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <fstream>
- using namespace std;
- int a,b,c;
- int main()
- {
- ofstream zapis_pliku ("plik.txt");
- for(int i=0;i<10;i++)
- {
- zapis_pliku<<1000+rand()%(1001)<<endl;
- }
- c=0;
- ifstream odczyt_pliku ("plik.txt"); //odczyt z pliku
- for(int i=0;i<10;i++)
- {
- odczyt_pliku>>a;
- if(c<a)
- {
- c=a;
- }}
- cout<<"najwieksza wartosc to ";
- cout<<c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement