Ответ:
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main() {
int arr[10], max = 0;
srand(time(NULL));
for (int i = 0; i < 10; i++) {
arr[i] = -10 + rand() % (10 + 10 + 1);
}
if (arr[i] < arr[i + 1]) {
max = arr[i+1];
cout << max;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main() {
int arr[10], max = 0;
srand(time(NULL));
for (int i = 0; i < 10; i++) {
arr[i] = -10 + rand() % (10 + 10 + 1);
}
for (int i = 0; i < 10; i++) {
if (arr[i] < arr[i + 1]) {
max = arr[i+1];
}
}
cout << max;
}