https://cs50.harvard.edu/x/2023/psets/3/runoff/ Runoff - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 지금 작성중 입니다... 3주차부터는 더욱 겸손해져서 낮은 난이도먼저 풀기로 했습니다 아래는 주어진 뼈대입니다 뼈대만 150줄이 넘네요 #include #include // Max voters and candidates #define MAX_VOTERS 100 #define MAX_CANDIDATES 9 // preferences[i][j] is jth ..
https://gmlwjd9405.github.io/2018/05/08/algorithm-merge-sort.html [알고리즘] 합병 정렬(merge sort)이란 - Heee's Development Blog Step by step goes a long way. gmlwjd9405.github.io https://gmlwjd9405.github.io/2018/05/06/algorithm-selection-sort.html [알고리즘] 선택 정렬(selection sort)이란 - Heee's Development Blog Step by step goes a long way. gmlwjd9405.github.io 버블 정렬(bubble sort) [알고리즘] 버블 정렬(bubble sort)이란 - H..
https://cs50.harvard.edu/x/2023/problems/3/snackbar/ 더보기 strings.h bcmp - compare byte sequences bcopy - copy byte sequence bzero - zero a byte string explicit_bzero - zero a byte string ffs - find first bit set in a word ffsl - find first bit set in a word ffsll - find first bit set in a word index - locate character in string rindex - locate character in string strcasecmp - compare two strings..
https://cs50.harvard.edu/x/2023/sections/3/ Week 3 Algorithms - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 좌측에 괄호 안 부분을 attribute 혹은 field 라고 부른다. + 좌측처럼 candidate를 연속으로 몇번 물어보면서 데이터를 체우게 할 수도 있음 for loop 특정 숫자에 접근하려면 점으로 해서 순서로 특정할수 있음. Recursion 재귀 예시 : Factorial 좌측과 같이 표현 가능함. 좌측보다도 (미완성임) 더 길게 ..
https://cs50.harvard.edu/x/2023/psets/2/substitution/ Substitution - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 하... 3시간째 작성중인데 하나씩 구현은 되는데 이젠 띄어쓰기를 인식을 못한다.ㅠㅠ 아래는 지금까지 작성한 코드 #include #include #include string substitution(string text, int length, string key); int main(int argc, string argv[]) { //..
https://cs50.harvard.edu/x/2023/psets/2/readability/ Readability - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu Coleman-Liau index index = 0.0588 * L - 0.296 * S - 15.8 L은 100단어당 들어간 알파벳의 숫자 S는 100단어당 들어간 문장의 숫자. 이 값을 이용하여 입력된 문장의 수준을 판별하는 프로그램 작성. 꽤나 복잡해서 의사코드 작성...을 한다고 했는데 그냥 대충쓴 코드처럼 썼다.. 이거 붙여넣고..
https://cs50.harvard.edu/x/2023/labs/2/ Lab 2: Scrabble - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu ascii code 를 활용한 간단한 scrabble game. 아래는 제출한 답안 코드 #include #include #include #include // Points assigned to each letter of the alphabet int POINTS[] = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3..
https://cs50.harvard.edu/x/2023/sections/2/ Week 2 Arrays - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu #include #include int main(int argc, string argv[]) { for (int i = 1; i < argc; i++) { printf("%c", argv[i][0]); } printf("\n"); } 출력예시 int main(int argc, string argv[]) 를 활용하면, command line argum..
https://cs50.harvard.edu/x/2023/sections/2/ Week 2 Arrays - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu #include #include #include int main (void) { string name = get_string("Type here: "); int length = strlen(name); int count = 0; for (int i = 0; i < length; i++) { if(i != 0) { if(name[i] < name[i-..
https://cs50.harvard.edu/x/2023/sections/2/ Week 2 Arrays - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu #include #include int main (void) { int length; do { length = get_int("Length :"); } while ( length < 1 ); int twice[length]; for (int i = 0, num = 1; i < length; i++, num = num * 2) { twice[i] = ..
https://cs50.harvard.edu/x/2023/psets/1/credit/ Credit - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu pseudocode (의사코드) 데이터 입력 Number : = (card_number) int d_1 = (card_number % 10000000000000000) / 1000000000000000 int d_3 = (card_number % 100000000000000) / 10000000000000 int d_5 = (card_number % 10..
https://cs50.harvard.edu/x/2023/psets/1/mario/more/ Mario - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu #include #include int main(void) { int height; do { height = get_int("Height :"); } while ( height > 8 || height < 1); for (int i = 0; i < height; i++) // i++는 { for(int j = i; j < height - 1; j++..
https://cs50.harvard.edu/x/2023/problems/1/half/ Half - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 제출한 답안 // Calculate your half of a restaurant bill // Data types, operations, type casting, return value #include #include float half(float bill, float tax, int tip); int main(void) { float bill_amoun..
https://cs50.harvard.edu/x/2023/labs/1/ Lab 1: Population Growth - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 제출한 답안 #include #include int main(void) { // TODO: Prompt for start size int start_size; do { start_size = get_int("Start size: "); } while ( start_size < 9 ); // TODO: Prompt for end size ..
https://cs50.harvard.edu/x/2023/problems/1/prime/ Prime - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 제출한 답안 #include #include bool prime(int number); int main(void) { int min; do { min = get_int("Minimum: "); } while (min = max); for (in..
while (true). = forever while (boolean-expr). =repeat until false ( 얼마나 작동할지 모르고, 작동 안할수도 있는 것; 게임등) do while. (boolean-expr). : 무조건 1번이상 작동 보장 (한번은 작동 보장(사용자에게 요청할때 많이 씀; 한번은 요청해야 하므로)) for (int i = 0; i < 10; i++). : 10번 반복 (시작; 조건; 증가/감소) (특정 숫자만큼 작동시키고 싶으나 그 횟수를 컴파일 시점에 모를때)
take … for granted ①…을 당연한 것이라고[의심할 여지가 없다고] 생각하다 https://cs50.harvard.edu/x/2023/weeks/5/ Week 5 Data Structures - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu 자료 https://okeybox.tistory.com/176 Queue : 식당 줄 비슷. first in first out FIFO enqueue : 줄에 입장 dequeue : 순서가 되어서 줄에서 나감 Stack : 쌓아둔 쟁반과 비슷. las..
https://cs50.harvard.edu/x/2023/weeks/3/ Week 3 Algorithms - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu linear search For each door from left to right If 50 is behind door Return true Return false //아래와 같이 의사코드(슈도코드) 작성 For i from 0 to n-1 If 50 is behind doors [i] Return true Return false binary s..
https://cs50.harvard.edu/x/2023/weeks/2/ Week 2 Arrays - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu tedious 지루한 exploit 이용하다 obnoxious 불쾌한 stipulate -을 규정하다 cipher 암호 code hello.c (생성) make hello (컴파일) ./hello (실행) 컴파일러 C언어 -> clang 원레 clang -o hello.c hello -lcs50 이지만, 줄여서 make hello 로 표현한다. 컴파일 과..
https://cs50.harvard.edu/x/2023/weeks/0/ Week 0 Scratch - CS50x 2023 Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. cs50.harvard.edu