Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<ctime>
- using namespace std;
- int main()
- {
- int posit, m = 0, i = 0, n;
- cout << ("Введите размер массива ");
- cin>> n;
- int* arr = new int[n];
- for (int i = 0; i < n; i++)
- {
- arr[i] = rand() % 100;
- cout<< arr[i]<< endl;
- }
- for (i = 2; i < n; i + 2)
- {
- if (m < arr[i])
- {
- m = arr[i];
- posit = i;
- }
- i = i + 2;
- }
- cout<< endl<<m<< endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement