Using namespace std; struct garaj {


Download 6.97 Kb.
Sana17.06.2023
Hajmi6.97 Kb.
#1533107
Bog'liq
dasturlash14


#include
#include
using namespace std;
struct garaj {
string markasi;
string egasi;

};

void mash_egasi_saralash(garaj t[], int n){



for (int i=0; i {
for (int j=i+1; j {

if(t[i].egasi {
struct garaj temp=t[i];
t[i]=t[j];
t[j]=temp;
}

}}}
int main () {
int n;
cout<<"mashinalar soni: ";
cin>>n;
garaj t[n];
cout< for (int i=0; i cout<<"mashina egasining ismi: ";
cin>>t[i].egasi;
cout<<"markasi: ";
cin>>t[i].markasi;


}
mash_egasi_saralash(t, n);
cout<<"Natija: "< for (int i=0; i if(t[i].markasi=="mercedes")

cout<
cout<<"\n";
}
return 0;
}


Download 6.97 Kb.

Do'stlaringiz bilan baham:




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