Guruh Yusubov mahmud


Download 26.4 Kb.
Sana11.01.2023
Hajmi26.4 Kb.
#1089546
Bog'liq
6-lab


931-19 guruh
Yusubov mahmud
Labaratoriya ishi 6
Mashina egalarining ismlari bo’yicha alifbo tartibida joylashtirilsin va
mos ravishda ularning mashinalari haqidagi ma’lumotlar chiqarilsin.
#include
using namespace std;
class mashina
{
public:
string egasi, mashrus, mashraq;
};
main()
{
mashina e[1001],mrus[1001],mraq[1001];
int n;
cout<<"Mashinalar sonini kiriting N=";
cin>>n;
cout<<"Mashina egasining ismi, rusumi va raqamlarini kiriting\n";
for (int i=1; i<=n; i++)
{
cout<cin>>e[i].egasi>>mrus[i].mashrus>>mraq[i].mashraq;
}
for (int i=2; i<=n; i++)
{
int j=i;
while(e[j].egasi{
swap(e[j-1],e[j]);
swap(mrus[j-1],mrus[j]);
swap(mraq[j-1],mraq[j]);
j=j-1;
}
}
cout<<"Saralangan ro`yxat:\n";
for (int i=1; i<=n; i++)
cout<}

Download 26.4 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling