1-Labaratoriya mashg’uloti. Ma’lumotlarni saralash algoritmlarini tartibli statistikasi


Download 78.89 Kb.
Sana16.11.2020
Hajmi78.89 Kb.
#146834
Bog'liq
cal lab1 10-variant


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;



}


Download 78.89 Kb.

Do'stlaringiz bilan baham:




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