Quick actions

cmd+k|ctrl+k

Navigation

Languages

112

Snippet info

Language

Cpp

Visibility

public

Author

nxnxngh

Created

2018-11-11T17:32:07Z

Updated

2018-11-26T18:35:18Z

#include <iostream>
#include <cmath>
#include <ctime>
using namespace std;

int main() {
	setlocale(LC_ALL, "ru");
	srand(time(NULL));
	int size = 2+rand() % 3;
	int *mass = new int[size];
	cout << "size = " << size << endl;
	for (int i = 0; i < size; i++)
	{
		mass[i] =160+ rand() % 40;
		cout << mass[i] << "\t";
	}
	cout << endl << endl << endl;
	int *n = &mass[0];
		for (int i = 1; i < size; i++)
		{
			if (*n < mass[i])
				*n = mass[i];
		}
		for (int i = 0; i < size; i++)
		{
			cout << mass[i] << "\t";
		}
		cout << endl;
		delete mass;
		system("PAUSE");
	return 0;
}
INFO