1-Labaratoriya mashg’uloti. Ma’lumotlarni saralash algoritmlarini tartibli statistikasi.
#include
using namespace std;
struct avtomobilchi
{
char name[100];
char rusum[100];
char nomer[100];
};
int main () {
int n;
cout<<"avtomobilchi sonini kiriting: ";
cin>>n;
avtomobilchi t[100];
cout<
for (int i=0; i
cout<<"\n"<
cin>>t[i].name;
cout<
cin>>t[i].rusum;
cout<
cin>>t[i].nomer;
}
cout<<"_________________________________________________________________________";
cout<<"\na) Avtomobil rusumi bo'lgan avtomobil raqamlari kamayish tartibida saralash:'\n";
for (int i=0; i
for (int j=i+1; j
string x=t[i].nomer,y=t[j].nomer;
if(x
swap(t[i],t[j]);
}
}
for(int i=0; i
string z=t[i].rusum;
if(z=="Mercedes"){
cout<
cout<
cout<
}
}
cout<<"\n\n";
return 0;
}
Do'stlaringiz bilan baham: |