9 ms·
I would do this: #define I 1 #define II 2 #define III 3 ... #define XIII 13 There is no zero in roman numerals, but you can use N
by yiyus 6y ago
I would do this:
#define I 1
#define II 2
#define III 3
...
#define XIII 13
There is no zero in roman numerals, but you can use NULL for extra fun! (yes, I am a bad person)
- eMSF 6y agoUsing NULL for the integer 0 requires a cast in C (because NULL may have a pointer type). That doesn't break the GP's rule, however neither does `!I` or `I-I`.
- Skeime 6y agoFor extra fun, put it into the code like this, including the `...` instead of the actual values. (Make it compile by commenting that line out.) Then define IV somewhere else but make sure to use III before every use IV so someone unfamiliar with these constants see the “right” definitions first.
- cratermoon 6y agoiv = secrets.randbits(IV) plaintext = "Text for encryption" aes = pyaes.AESModeOfOperationCTR(key, pyaes.Counter(iv)) ciphertext = aes.encrypt(plaintext) print('Encrypted:', binascii.hexlify(ciphertext))
- thechao 6y agoThe Roman numeral for ‘0’ is (nonclassically) ‘N’; there are attestations going back to the early 6th c. It stands for “nulla” or “nihila”.
- nneonneo 6y agoOr, just program in INTERCAL (https://en.wikipedia.org/wiki/INTERCAL https://en.wikipedia.org/wiki/INTERCAL)! Integers are input in English (e.g. THREE FIVE NINE) and output in Roman numerals.
- munificent 6y ago> There is no zero in roman numerals #define X_MINUS_V_MINUS_IV_MINUS_I 0