Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- int tab[10];
- int najw=1,najm=50;
- srand(time(NULL));
- for(int i=0; i<10; i++)
- {
- tab[i] = rand()%50+1;
- if(tab[i] > najw)
- {
- najw = tab[i];
- }
- if(tab[i] < najm)
- {
- najm = tab[i];
- }
- cout<<tab[i]<<endl;
- }
- cout<<"Najmniejsza liczba: "<<najm<<endl;
- cout<<"Najwieksza liczba: "<<najw;
- return 0;
- }
Add Comment
Please, Sign In to add comment