diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-03-26 18:09:15 +0100 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-03-26 18:09:15 +0100 |
commit | 96df60657966f3934451ecd6da92d63a500adcf7 (patch) | |
tree | d9645c943345d069cb468494989cf5cdc499c421 /Semestr 4/ask/lista2 | |
parent | d6e7fae474dc97e46990a45b48ac4f69a35072eb (diff) |
changed dirs names
Diffstat (limited to 'Semestr 4/ask/lista2')
-rw-r--r-- | Semestr 4/ask/lista2/ask21_lista_2.pdf | bin | 0 -> 137597 bytes | |||
-rw-r--r-- | Semestr 4/ask/lista2/pom.c | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/Semestr 4/ask/lista2/ask21_lista_2.pdf b/Semestr 4/ask/lista2/ask21_lista_2.pdf Binary files differnew file mode 100644 index 0000000..e6df9d7 --- /dev/null +++ b/Semestr 4/ask/lista2/ask21_lista_2.pdf diff --git a/Semestr 4/ask/lista2/pom.c b/Semestr 4/ask/lista2/pom.c new file mode 100644 index 0000000..87d542d --- /dev/null +++ b/Semestr 4/ask/lista2/pom.c @@ -0,0 +1,38 @@ +#include <stdint.h> +#include <stdio.h> +#include <limits.h> + +char* utb(uint32_t x) { + static char rep[36]; + int cnt = 34; + for (int i = 0; i < 32; i += 1) { + if (i > 0 && i % 8 == 0) { + rep[cnt] = ' '; + cnt -= 1; + } + rep[cnt] = (x & 1) + '0'; + cnt -= 1; + x >>= 1; + } + rep[35] = '\0'; + return rep; +} + +void pb(uint32_t x) { + printf("%s : %d\n", utb(x), x); +} + +// int main() { +// /* Zadanie 1 */ + +// int32_t x; +// x = (1<<31); +// printf("%d, %d, %d %d\n", x, (x > 0), x-1, (x - 1 < 0)); +// } + +int main() { + /* Zadanie 1 */ + int32_t x; + scanf("%d", &x); + printf("%d %d\n", x*x, INT_MIN); +}
\ No newline at end of file |