Search
for
while
do-while
break
1, -1, 1, -1, 1, -1, ...
~/ctu-fee/prp/lab02
unzip b3b36prg-hw01.zip
unzip b3b36prg-hw01.zip Archive: b3b36prg-hw01.zip creating: b3b36prg-hw01/ extracting: b3b36prg-hw01/generate_solutions.sh creating: b3b36prg-hw01/data/ extracting: b3b36prg-hw01/data/pub01.out extracting: b3b36prg-hw01/data/pub07.err extracting: b3b36prg-hw01/data/pub05.in extracting: b3b36prg-hw01/data/pub01.err extracting: b3b36prg-hw01/data/pub04.in extracting: b3b36prg-hw01/data/pub04.out extracting: b3b36prg-hw01/data/pub03.err extracting: b3b36prg-hw01/data/pub06.in extracting: b3b36prg-hw01/data/pub06.err extracting: b3b36prg-hw01/data/pub02.err extracting: b3b36prg-hw01/data/pub07.out extracting: b3b36prg-hw01/data/pub03.in extracting: b3b36prg-hw01/data/pub02.in extracting: b3b36prg-hw01/data/pub03.out extracting: b3b36prg-hw01/data/pub05.err extracting: b3b36prg-hw01/data/pub01.in extracting: b3b36prg-hw01/data/pub06.out extracting: b3b36prg-hw01/data/pub05.out extracting: b3b36prg-hw01/data/pub02.out extracting: b3b36prg-hw01/data/pub04.err extracting: b3b36prg-hw01/data/pub07.in extracting: b3b36prg-hw01/b3b36prg-hw01-genref extracting: b3b36prg-hw01/Makefile extracting: b3b36prg-hw01/main.c creating: b3b36prg-hw01/binaries/ extracting: b3b36prg-hw01/binaries/b3b36prg-hw01-genref-osx
tree
tree b3b36prg-hw01 b3b36prg-hw01 ├── Makefile ├── b3b36prg-hw01-genref ├── binaries │ └── b3b36prg-hw01-genref-osx ├── data │ ├── pub01.err │ ├── pub01.in │ ├── pub01.out │ ├── pub02.err │ ├── pub02.in │ ├── pub02.out │ ├── pub03.err │ ├── pub03.in │ ├── pub03.out │ ├── pub04.err │ ├── pub04.in │ ├── pub04.out │ ├── pub05.err │ ├── pub05.in │ ├── pub05.out │ ├── pub06.err │ ├── pub06.in │ ├── pub06.out │ ├── pub07.err │ ├── pub07.in │ └── pub07.out ├── generate_solutions.sh └── main.c 3 directories, 26 files
b3b36prg-hw01-genref
diff
vimdiff
hexdump
for, while, do-while
* ** *** **** *****
***** **** *** ** *
putchar
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
0 11 22 33 44 55 66 77 88 99
9 18 27 36 45 54 63 72 81 90
0 9 11 18 22 27 33 36 44 45 54 55 63 66 72 77 81 88 90 99
printf()
v « 1
FALSE
TRUE
getchar
man getchar
EOF
100
0
clang main.c && echo 'a' | ./a.out 97 61 b01100001
cal
Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
September Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
September Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 October Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 November Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
static char *day_of_week[] = {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" }; static char *name_of_month[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; static int days_in_month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int first_day_in_september = 2; // 1. 9. 2021 is Wednesday static int first_day_in_year = 4; // 1. 1. 2021 is Friday
$$ \qquad\pi = 4 \sum_{k=0}^\infty\dfrac{(-1)^k}{2k+1} = \dfrac{4}{1}-\dfrac{4}{3}+\dfrac{4}{5}-\dfrac{4}{7}+\dfrac{4}{9}-\dfrac{4}{11}+\cdots $$