본문 바로가기
반응형

전체 글50

#13 구조체 포인터 | c++ #구초제 포인터 정의 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include //구조체 포인터 struct ProductInfo { int num; char name[100]; int cost; }; int main(){ ProductInfo myProduct = { 4797283, "제주 한라봉", 19900}; ProductInfo *ptr_product = &myProduct; std::cout 2021. 9. 20.
#12 구조체 | struct | c++ 구조체의 정의를 보여주는 코드 예제부터 먼저 보여주면, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include struct Pair {int x,y;}; void func(Pair p){ Pair q; } int main(){ Pair p; p.x = 3; p.y = 4; std::cout 2021. 9. 20.
#11 typedef 구조체를 공부하기 전, 구조체를 더 이해하기 쉽도록 typedef 개념들을 공부! #typedef 1 2 3 4 5 6 7 8 9 10 11 #include //type define //형을 정의 int main(){ typedef int Int32; Int32 n = 20; std::cout 2021. 9. 20.
#10 배열을 매개변수로 넘기기 문제 | 띄어쓰기없이 출력하기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /* 문자열을 매개변수로 받아 그 문자열에서 공백을 제거하여 출력하는 함수를 작성해 보세요. */ #include void print_noSpace(/*작성*/){ //작성 } int main(){ print_noSpace("Hello, World!\n"); print_noSpace("My name is Doodle\n"); } Colored by Color Scripter cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 /* 문자열을 매개변수로 받아 그 문자열에서 공백을 제거하여 출력하는 함수를 작성해 보세요. */ #include void print_noSpace(char *arr){.. 2021. 9. 20.
01 Introduction to Linear Programming Linear functions: f(x1, x2) = 2x1 + 3x2, f(x1, x2, x3) = 3x1 + 5x2 - x3 Nonlinear functions: f(x1, x2) = 2(x1^2) - (5^x2) f(x1, x2, x3) = sin(x1) + 5x2 - (1/(x^5)) LP formulations - standard form (equality constraints) : minimize z = cx, subject to Ax = b, x >= 0, - canonical forms for minimization and maximization problems (inequality constraints) : minimize z = cx, maximize z = cx, subject to .. 2021. 9. 11.
#9 배열을 매개변수로 넘기기 | c++ #call-by-reference 일차원 배열 1. 1 2 3 4 5 6 7 8 9 10 11 12 13 #include //call-by-reference void printArr(int arr[4]){ for (int i = 0; i 2021. 8. 26.
반응형