CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 11:47:35 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=71576cf5ca8151455004ae17f978355a46a2f25e23902f14c910b20916c67bcfa%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22_KtZv6qZhYIW5_XgOSLy2KTW9t5Cjrug%22%3B%7D; HttpOnly; Path=/
cf-ray: 98de9a611a308cf1-BLR
sort animals stl - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- class Animal {
- public:
- Animal(string name, int age): name(name), age(age) {}
- inline int getAge() const {
- return this->age;
- }
- friend ostream& operator << (ostream &out, const Animal &animal) noexcept ;
- private:
- string name;
- int age;
- };
- ostream& operator << (ostream &out, const Animal &animal) noexcept {
- out << animal.name << ' ' << animal.age;
- return out;
- }
- class Dog : public Animal {
- public:
- Dog(string name, int age): Animal(name, age) {}
- };//*/
- class Cat : public Animal {
- public:
- Cat(string name, int age): Animal(name, age) {}
- };
- int main() {
- vector<Animal> animals = {
- Dog("azor", 11), Cat("thomas", 5), Dog("rex", 12)
- };
- sort(animals.begin(), animals.end(), [](const auto &fi, const auto &se) {
- return fi.getAge() < se.getAge();
- });
- for (const auto &animal : animals) {
- cout << animal << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐MAKE $9OO INSTANTLY D M⭐⭐
Java | 1 sec ago | 0.15 KB
-
⚡ Crypto Swap Glitch ✅ Working ⚡
JavaScript | 4 sec ago | 0.24 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ H
JavaScript | 4 sec ago | 0.25 KB
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 6 sec ago | 0.15 KB
-
⭐⭐⭐Free Giftcards Method⭐⭐
Java | 9 sec ago | 0.15 KB
-
📝 EASY MONEY GUIDE ✅ Working R
JavaScript | 12 sec ago | 0.25 KB
-
💡 Instant BTC Profit Method ✅ Working
JavaScript | 14 sec ago | 0.24 KB
-
⭐⭐⭐Swapzone.io Glitch (Working)⭐⭐
Java | 17 sec ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand