#include #include #include using namespace std; struct EnumNat { string curr; EnumNat() { curr = "0"; } string get() { return curr; } void move_on() { for (int i = curr.length()-1; i >= 0; i -= 1) { if (curr[i] == '9') curr[i] = '0'; else { curr[i] += 1; return; } } curr = string("1") + curr; } bool finished() { return false; } }; struct EnumEven { EnumNat nats; EnumEven() { } string get() { return nats.get(); } void move_on() { nats.move_on(); nats.move_on(); } bool finished() { return nats.finished(); } }; const string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ `~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?"; struct EnumStr { string curr; EnumStr() { curr = ""; } string get() { return curr; } void move_on() { for (int i = curr.length()-1; i >= 0; i -= 1) { if (curr[i] == '?') curr[i] = '0'; else { int pos = alphabet.find(curr[i]); curr[i] = alphabet[pos+1]; return; } } curr = string("0") + curr; } bool finished() { return false; } }; struct EnumRat { int top, bottom; EnumRat() { top = 0; bottom = 1; } string get() { ostringstream os; os << top << "/" << bottom; return os.str(); } void move_on() { int diag = top + bottom; top -= 1; bottom += 1; if (top <= 0) { top = diag; bottom = 1; } } bool finished() { return false; } }; int main() { EnumNat En; EnumRat Eq; while (! En.finished() && ! Eq.finished()) { cout << En.get() << " -> " << Eq.get() << "\n"; En.move_on(); Eq.move_on(); } }