Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- using namespace std;
- void main()
- {
- int i, j, k, n, A[25];
- cin >> n;
- srand(time(0));
- for (i = 0; i < n; i++)
- {
- A[i] = rand() % 100; cout << A[i] << " ";
- }
- for (i = 1, k = 0; i < n; i++)
- {
- if (A[i] > A[k]) k = i;
- }
- for (j = k; j < n - 1; j++)
- {
- A[j] = A[j + 1];
- }
- n--;
- cout << " " << endl;
- for (i = 0; i < n; i++)
- {
- cout << A[i] << " ";
- }
- cin.get();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement