Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdio>
- #include <cstdlib>
- using namespace std;
- void los(double *tab, int n) {
- srand(time(0));
- for (int i = 0; i < n; i++) {
- *(tab + i) = (double)rand() / RAND_MAX * 2 - 1;
- }
- }
- int main()
- {
- double tab[10];
- los(tab, 10);
- for (int i = 0; i < 10; i++) {
- cout << tab[i] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement