From 647fafedf582a892db8b7f2c2858ad1bad3307db Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Sun, 7 Mar 2021 17:58:54 +0100 Subject: Aktualizacja --- Semestr 4/ask/hackersdelight.pdf | Bin 0 -> 25678006 bytes Semestr 4/ask/lista 2/ask21_lista_2.pdf | Bin 0 -> 137597 bytes Semestr 4/ask/lista 2/pom.c | 38 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 Semestr 4/ask/hackersdelight.pdf create mode 100644 Semestr 4/ask/lista 2/ask21_lista_2.pdf create mode 100644 Semestr 4/ask/lista 2/pom.c (limited to 'Semestr 4/ask') diff --git a/Semestr 4/ask/hackersdelight.pdf b/Semestr 4/ask/hackersdelight.pdf new file mode 100644 index 0000000..9f0003f Binary files /dev/null and b/Semestr 4/ask/hackersdelight.pdf differ diff --git a/Semestr 4/ask/lista 2/ask21_lista_2.pdf b/Semestr 4/ask/lista 2/ask21_lista_2.pdf new file mode 100644 index 0000000..e6df9d7 Binary files /dev/null and b/Semestr 4/ask/lista 2/ask21_lista_2.pdf differ diff --git a/Semestr 4/ask/lista 2/pom.c b/Semestr 4/ask/lista 2/pom.c new file mode 100644 index 0000000..87d542d --- /dev/null +++ b/Semestr 4/ask/lista 2/pom.c @@ -0,0 +1,38 @@ +#include +#include +#include + +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 -- cgit v1.2.3