Search
for
while
do-while
break
1, -1, 1, -1, 1, -1, ...
~/ctu-fee/prg/lab01
unzip bab36prga-hw1.zip
unzip ~/Downloads/bab36prga-hw1.zip Archive: /home/jf/Downloads/bab36prga-hw1.zip creating: bab36prga-hw1/ extracting: bab36prga-hw1/generate_solutions.sh creating: bab36prga-hw1/data/ extracting: bab36prga-hw1/data/pub01.out extracting: bab36prga-hw1/data/pub01.err extracting: bab36prga-hw1/data/pub03.err extracting: bab36prga-hw1/data/pub02.err extracting: bab36prga-hw1/data/pub03.in extracting: bab36prga-hw1/data/pub02.in extracting: bab36prga-hw1/data/pub03.out extracting: bab36prga-hw1/data/pub01.in extracting: bab36prga-hw1/data/pub02.out extracting: bab36prga-hw1/bab36prga-hw1-genref extracting: bab36prga-hw1/Makefile extracting: bab36prga-hw1/bab36prga-hw1-genref-osx-intel extracting: bab36prga-hw1/main.c extracting: bab36prga-hw1/bab36prga-hw1-genref-osx-m1
tree
tree bab36prga-hw1 bab36prga-hw1 ├── Makefile ├── bab36prga-hw1-genref ├── bab36prga-hw1-genref-osx-intel ├── bab36prga-hw1-genref-osx-m1 ├── data │ ├── pub01.err │ ├── pub01.in │ ├── pub01.out │ ├── pub02.err │ ├── pub02.in │ ├── pub02.out │ ├── pub03.err │ ├── pub03.in │ └── pub03.out ├── generate_solutions.sh └── main.c 2 directories, 15 files
bab36prga-hw1-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 $$