23- Notebook classini yaratish.
cout<
cout<<"Notebook nomi:";cin>>a[i].name;cout<
cout<<"Notebook narxi:";cin>>a[i].narxi;cout<
void saralash(Notebook a[], int n){
for(int i=0;i
for(int j=0;j
if(a[i].narxi>a[j].narxi)
swap(a[i],a[j]); } } }
void qidirish(Notebook a[], int n){
string s;
cout<<"qidirayotgan notebook nomini kiriting:";
cin>>s;
for(int i=0;i
if(a[i].name==s) {
cout<<"siz qidirgan notebook: ";
cout<
void get ( Notebook a[], int n){
for(int i=0;i
cout<
using namespace notebook;
int main()
{
int y;
Notebook a[100]; int n;
cout<<"Notebooklar soni: ";
cin>>n;
a[100].set(a,n);
cout<<"qidirish funksiyasi 1\nsaralash 2"<
cin>>y;
switch(y){
case 1:a[100].qidirish(a,n);break;
case 2:a[100].saralash(a,n);break;
a[100].get(a,n); } }
Dostları ilə paylaş: