1-LABARATORIYA ISHI
Varyant No 14
14. VECTOR hosil qiling elementlarini kamayish tartibida saralang
#include
#include
#include
#include
using namespace std;
int main()
{
int k;
cout << "Vectorning elementlari sonini kiriting: ";
cin >> k;
cout << "Vectorning elementlarini kiriting: ";
vectora;
for (int i = 1; i <= k; i++)
{
int y;
y = rand() % 1000;
a.push_back(y);
}
cout << "Saralangan vector:\n";
(a.rbegin(), a.rend());
for (int i = 0; i < a.size(); i++)
cout << a[i] << ' ';
system("pause");
}
N atija:
Do'stlaringiz bilan baham: |