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 <stdlib.h> | |
| #include <math.h> | |
| double avg(double a, double b) | |
| { | |
| return (a + b) / 2; | |
| } | |
| int main(int argc, char **argv) |
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
| /* Convert little-endian hexadecimal string to big-endian ASCII */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int main(int argc, char** argv) | |
| { | |
| if (argc < 2) | |
| return EXIT_FAILURE; |
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 <stdlib.h> | |
| #include <inttypes.h> | |
| #include <string.h> | |
| static const char *input = "\ | |
| 08 02 22 97 38 15 00 41 00 75 04 05 07 78 52 12 50 77 91 08 \ | |
| 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 \ | |
| 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 \ | |
| 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 \ |
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 <stdlib.h> | |
| #include <inttypes.h> | |
| /* gcc fizzbuzz.c -nostartfiles -O3 -std=c11 -march=native */ | |
| _Noreturn void _start() | |
| { | |
| for (register uint_fast8_t i = 1; i <= 100; ++i) | |
| printf("%" PRIuFAST8 " %s", i, (i % 15 == 0 ? "FizzBuzz\n" : (i % 5 == 0 ? "Buzz\n" : (i % 3 == 0 ? "Fizz\n" : "\n")))); |
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 <stdlib.h> | |
| int do_algo(int a, int b, int r) | |
| { | |
| while(1) | |
| { | |
| printf("%d\t%d\t%d\t\n", a, b, r); | |
| if (r == 0) | |
| return b; |