Created
November 13, 2021 10:11
-
-
Save bphucc/ff2acf19cf9554d6f5300490ce0e8353 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| class Ulong { | |
| private: | |
| long long value; | |
| public: | |
| Ulong(long long x) : value(x){} | |
| ~Ulong(){} | |
| friend bool operator ==(const Ulong x1, const Ulong x2){ | |
| return x1.value == x2.value; | |
| } | |
| friend std::ostream &operator <<(std::ostream &os, Ulong obj){ | |
| os << obj.value << std::endl; | |
| return os; | |
| } | |
| }; | |
| void sosanh(Ulong x1, Ulong x2){ | |
| std::string out = (x1 == x2) ? "True" : "False"; | |
| std::cout << out << std::endl; | |
| } | |
| int main(){ | |
| Ulong obj(1024), obj1(9981), obj3(1024); | |
| sosanh(obj1, obj); | |
| sosanh(obj, obj3); | |
| std::cout << obj << obj1 << std::endl; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment