init commit

This commit is contained in:
2025-04-13 21:48:15 +03:00
commit 23255e9121
192 changed files with 12200 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <string>
using namespace std;
class BinaryNumber
{
string str;
public:
BinaryNumber(const string& s = "0") {
str = s;
}
operator string () const {
return str;
}
const BinaryNumber& operator++() {
std::string::iterator i = str.end() - 1;
while (*i == '1' && i != str.begin()) {
*i = '0';
--i;
}
if (i == str.begin()) {
str.insert(str.begin(), '1');
} else {
*i = '1';
}
return *this;
}
};