본문 바로가기
반응형

CS505

Algorithms(week3, problemset) 1. Plurality 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 100 101 102 103 104 105 106 107 108 109 #include #include #include #define MAX 9 typedef struct{ .. 2020. 1. 6.
Arrays(week 2, problem set) 1. Readability 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 #import #import #import #import int main(int argc, char *argv[]){ int z; if(argc = 3){ printf("Usage: ./caesar key\n"); return 1; } else if((z = atoi(argv[1])) == 0 ){ printf("Usage: ./caesar key\n"); return 1; } z = atoi(argv[1]).. 2019. 12. 30.
C Programming Language(week1, problem set) https://cs50.harvard.edu/college/psets/1/ 1. Hello 1 2 3 4 5 6 7 8 #include #include int main(void) { string name = get_string("What is your name?\n"); printf("hello, %s\n", name); } 2a. Mario less 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include #include int main(void) { int stairs = get_int("Height: "); while(!(stairs >= 1 && stairs 2019. 12. 30.
Memory (week3) Compiling contains four steps, preprocessing, compiling, assembling and linking. First convert a source code into required functions, like for instance in c, read hashtags and copy and past files. Second step is compiling, convert source code into assembling codes. Third step is assembling, converting assembling codes into machine codes, 1s and 0s. Last, link all files into 0s and 1s. Programmer.. 2019. 12. 27.
Arrays and Sorting Algorithms (week2) Preprocessing – #include Compiling - programming language converts codes to assembly language for computer to understand Assembling – using assembling code and converts to 10101010100101001010s(machine code, object code) Linking – linking step links all the imported files, stdio.h + cs50.h + yourfile.h. These days, people call these four steps compiling to be general. Ram, random access memory, .. 2019. 12. 26.
반응형