#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;
}
Do'stlaringiz bilan baham: |