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
| int swit(int num) | |
| { | |
| switch (num) { | |
| case 0xA1: | |
| case 0xA2: | |
| case 0xA3: | |
| case 0xA4: | |
| case 0xB2: | |
| case 0xB3: | |
| case 0xB4: |
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 <stdio.h> | |
| int p(int a, int b) { | |
| (a > b && printf("%d\n", a) && p(a - 1, b) | |
| || a == b && printf("%d\n", a) | |
| || a < b && printf("%d\n", b) && p(a, b - 1)); | |
| return 0; // Useless return value. Only here to evaluate recursed p(). | |
| } | |
| int main(void) { |
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
| if (rtn == RESULT_A || rtn == RESULT_B || rtn == RESULT_C || rtn == RESULT_D) { | |
| Do1(); | |
| } else { | |
| Do2(); | |
| } | |
| switch (rtn) { | |
| case RESULT_A: | |
| case RESULT_B: | |
| case RESULT_C: |
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 <inttypes.h> | |
| void encrypt1(uint8_t *tmp, uint8_t *iv, uint8_t *in, uint32_t len) | |
| { | |
| for (uint_fast32_t pos = 0; pos < len; pos += 8) { | |
| for (uint_fast8_t i = 0; i < 8; i++) { | |
| tmp[i] = in[pos + i] ^ iv[i]; | |
| } | |
| } | |
| } |
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
| (* To build: corebuild digit5.native *) | |
| (* To test-run: seq 10000 99999 |./digit5.native *) | |
| open Core.Std | |
| type t = int Char.Map.t | |
| let empty = Char.Map.empty | |
| let rec read_loop proc = | |
| match In_channel.input_line In_channel.stdin with |
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 <stdio.h> | |
| #include <inttypes.h> | |
| void print_bit(uint8_t c, FILE* s) { | |
| uint_fast8_t i = 8; | |
| AGAIN: | |
| if (i > 0) { | |
| putc(((c & 0x80) ? '1' : '0'), s); | |
| c <<= 1; |
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
| open Core.Std | |
| let rec q2 () = | |
| print_endline "Enter a 7-digit number: "; | |
| let input_str = input_line stdin in | |
| if String.length input_str <> 7 then | |
| q2 () | |
| else | |
| String.to_list input_str | |
| |> List.map ~f:Char.to_string |
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
| void q2(int n) { | |
| bool shown = false; | |
| char one_zero; | |
| int n2 = 0x80; | |
| CAL: | |
| if (n >= n2) { | |
| n -= n2; | |
| one_zero = '1'; | |
| } else { |
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
| void q2(int n) { | |
| bool shown = false; | |
| char one_zero; | |
| int n2 = 0x80; | |
| CAL: | |
| if (n >= n2) { | |
| n -= n2; | |
| one_zero = '1'; | |
| } else { |
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
| /* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ | |
| // DO NOT EDIT THIS FILE, it will be overwritten on update | |
| // | |
| // Default rules for polkit | |
| // | |
| // See the polkit(8) man page for more information | |
| // about configuring polkit. | |
| polkit.addRule(function(action, subject) { |