Quick actions

cmd+k|ctrl+k

Navigation

Languages

87

Snippet info

Language

Cpp

Visibility

public

Author

nxnxngh

Created

2018-11-11T17:32:11Z

Updated

2018-11-26T18:20:16Z

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

int main() {
	setlocale(LC_ALL, "ru");
	srand(time(NULL));
	int size = 1 + rand() % 20,n=0;
	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;
	for (int i = 1; i < size; i++)
	{
		n = i - 1;
		if (mass[i] < mass[n])
			cout <<i<<"th \t"<< "TRUE" << endl;
		else
		{
			cout << i << "th \t" << "FALSE" << endl;
			break;
		}

	}
	
		delete mass;
		system("PAUSE");
	return 0;
}
INFO