|
Bajardi: Turdiaxmedova Zebo
|
tarix | 11.05.2023 | ölçüsü | 215,32 Kb. | | #110964 |
| Zebo Turdiaxmedova
Bajardi: Turdiaxmedova Zebo
C++ kodi:
#include
#include
#include
#include
using namespace std;
class onlineshop{
public:
int narx;
string kiyim_nomi;
string turi;
onlineshop(string k,int n,string t){
kiyim_nomi=k;
turi=t;
narx=n;
}
onlineshop (){}
string getKiyim_nomi(){
return kiyim_nomi;
}
int getNarx(){
return narx;
}
string getTuri(){
return turi;
}
bool operator<(const onlineshop& other) const {
return narx < other.narx;
}
};
bool is_even( onlineshop sh) {
int n=sh.getNarx();
return (n>5500);
}
int main()
{
bool result;
vector c;
onlineshop sh;
c.push_back(onlineshop("kepka", 89000,"boshkiyim"));
c.push_back( onlineshop("yubka", 150000,"yubkalar"));
c.push_back( onlineshop("kofta", 99000,"koftalar"));
vector v={sh.getNarx(),80000,150000};
result = all_of(c.begin(), c.end(), is_even);
if (result == true)
cout << "Vector contains all even numbers." << endl;
return 0;
}
Dostları ilə paylaş: |
|
|