Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using std::cout;
- using std::endl;
- int main() {
- int n;
- cout << "Input n: ";
- scanf("%d", &n);
- int result[n];
- srand(time(NULL));
- for (int i = 0; i < n; i++) {
- result[i] = rand() % 100 + 1;
- }
- for (int i = 0; i < n; i++) {
- cout << result[i] << " ";
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement