|
Mavzu: Dars jadvali (maktab) #include "stdafx h"
|
tarix | 22.06.2022 | ölçüsü | 0,68 Mb. | | #62117 |
| list(jadval)
Mavzu: Dars jadvali (maktab)
#include "stdafx.h"
#include
#include
#include
using namespace std;
using namespace System;
class Dars_jadval{
public:
string nomi, kun;
int soati, sinf;
void kirit(int i){
cout<cout<<" fan nomi = "; cin>>nomi;
cout<<" umumiy soati = "; cin>>soati;
cout<<" haftaning qaysi kuni = "; cin>>kun;
cout<<" nechanchi sinf = "; cin>>sinf;
}
void malumot(){
cout<"<}
bool operator < (const Dars_jadval &ob) const
{
return this->nomi}
};
int main()
{
list m;
string nom, kun; int soat, sinf;
int n; cout<<" Fanlar soni: "; cin>>n;
for(int i=0; i{
Dars_jadval d;
d.kirit(i);
m.push_back(d);
}
cout<<"\n\n\n";
cout<<"Fan nomi bo'yicha tartiblangandan keyin \n\n";
m.sort();
for(auto k:m){
k.malumot();
}
cout<<"\n\n\n";
qayta:
bool yoq=true; int j=0;
cout<<"Salom,qaysi fan kerak edi? "; cin>>nom;
for(auto k=m.begin(); k!=m.end(); k++)
{
if(k->nomi==nom) {
yoq=false;
cout<<"Xohlagan faningiz topildi! \n";
k->malumot();
}
}
if(yoq) cout<<"Kechirasiz bizda siz tanlagan fan yo'q!\n";
cout<<"\n\n\n";
system("pause")
return 0;
}
Dostları ilə paylaş: |
|
|