123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * я хз зачем это сделал
- *
- * meow => ~omm
- * the test phrase => acubld pced uh`
- * тестовая фраза => 070QpPx>5
- *
- * оно не любит киррилицу
- */
- #include <stdio.h>
- #include <string.h>
- int main(int argc, char* argv[])
- {
- if (argc <= 1)
- return 1;
- const char* src = argv[1];
- const int src_len = strlen(src);
- unsigned int sum = 0;
- for (int i = 0; i < src_len; i++)
- sum += src[i];
- for (int i = 0; i < src_len; i++) {
- unsigned char step1 = (src[i] ^ sum) | ~src[i] ^ 0b11110000;
- unsigned char step2 = step1 | src[i] & 0b11110000;
- unsigned char step3 = (step2 ^ (~src[src_len - i - 1] & 0x7f));
- if (step3 < 31)
- step3 += src[src_len - i - 1] & 0b00001111;
- if (step3 > 127)
- step3 ^= 0b10000000;
- if (step3 == 127)
- step3--;
- /* printf("(step1 %d) (step2 %d) (step3 %d)\n", step1, step2, step3); */
- putchar(step3);
- }
- puts("");
- }
|