#include #include #include #include using namespace std; void main () { const int TAMAGNO =20; const int MAX_RANDOM =200; vector notas; srand(time(NULL)); cout << "Lista de Datos ingresados aleatoriamente\n"; cout << "========================================\n"; cout << "Dato aleatorio" << "\tTamaņo vector" << "\t Capacidad" << endl; for (int i=0; i < TAMAGNO; i++) { notas.push_back(rand()%MAX_RANDOM); cout << notas.back() << "\t\t\t" << notas.size() << "\t\t" << notas.capacity() << endl; } sort(notas.begin(),notas.end()); cout << "Lista de Datos Ordenados ascendente\n"; cout << "========================================"<< endl; for (int i=0; i < notas.size(); i++) cout << notas[i]<< endl; sort(notas.rbegin(), notas.rend()); cout << "Lista de Datos Ordenados descendente\n"; cout << "========================================"<< endl; for (int i=0; i < notas.size(); i++) cout << notas[i]<< endl; }