Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- int los (int a)
- {
- int x;
- srand(time(0));
- a =1 + rand() % 11;
- int i=1;
- while (i<6)
- {
- a = (rand() % 11);
- if (a>=x)
- {
- cout<<a<<" ";
- x=a;
- i++;
- }
- }
- return a;
- }
- main()
- {
- cout<<"Ciag niemalejacy 6 losowych liczb 1-10"<<endl;
- int x;
- cout<<los(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement