목록Programming (65)
빙수달 게임 개발 노트
윈도우 프로시저 내부만 작성하였다.LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ HDC hdc; PAINTSTRUCT ps; HBRUSH hBrush, oldBrush; static POINT pos; static RECT rectView; static bool flag_East; static bool flag_South; static bool flag_West; static bool flag_North; switch (message) { case WM_CREATE: { pos.x = 50; pos.y = 50; ..
// Caret.cpp : 애플리케이션에 대한 진입점을 정의합니다.//#include "framework.h"#include "Caret.h"#define MAX_LOADSTRING 100void DrawGrid(HDC hdc, POINT center, int Width, int Height, int Count){ int Row_count = Height / Count; int Col_count = Width / Count; POINT startPoint = { center.x - Width / 2, center.y - Height / 2 }; POINT endPoint{ center.x + Width / 2, center.y + Height / 2 }; // 행 출력 ..
// Caret.cpp : 애플리케이션에 대한 진입점을 정의합니다.//#include "framework.h"#include "Caret.h"#define MAX_LOADSTRING 100void DrawCircle(HDC hdc, POINT center, int Radius){ Ellipse(hdc, center.x, center.y, Radius, Radius);}// 전역 변수:HINSTANCE hInst; // 현재 인스턴스입니다.WCHAR szTitle[MAX_LOADSTRING]; // 제목 표시줄 텍스트입니다.WCHAR szWindowClass[MAX_LOADSTRING]; // 기..
#include using namespace std;struct student // 학생에 대한 정보{ int id; string name; student* next; // 다음 학생을 가리킴};class studentBook{ student* head; // 리스트의 맨 앞 student* node; // 가리키고자 하는 노드public: studentBook(); void insert(int id, string name); void remove(int id); void print(); void search(int id);};int main(){ int num = 0; //..
#include using namespace std;int BruteForce(const string &txt, const string &pat){ std::size_t pt = 0; std::size_t pp = 0; while (pt > txt; cout > pat; int idx = BruteForce(txt, pat); if (idx == -1) { "텍스트 내에 패턴이 없습니다"; } else { cout
#include #include using namespace std;int main(){ const int num = 5; int arr[num] = { 0 }; for (int i = 0; i > arr[i]; } for (int i = 1; i = 0; j--) { if (temp > arr[j] ) { break; } else { arr[j+1] = arr[j]; // 값복사 arr[j] = temp; } } } f..
#include #include using namespace std;int main(){ const int num = 5; int arr[num] = { 0 }; int minidx = 0; // 가장 작은 값 인덱스 기억 for (int i = 0; i > arr[i]; } for (int i = 0; i arr[j]) { minidx = j; //swap(arr[i], arr[j]); } } if (minidx != i) { swap(arr[i], arr[minidx]); } } f..
// IntStack.h#ifndef ___IntStack#define ___IntStacktypedef struct { int max; // 스택 용량 int ptr; // 스택에 쌓여 있는 데이터의 개수 int* stk; // 스택의 첫 요소에 대한 포인터} IntStack;int Initialize(IntStack *s, int max); // 스택 초기화int Push(IntStack* s, int x); // 스택에 데이터를 푸쉬int Pop(IntStack* s, int* x); // 스택에서 데이터를 팝int Peek(const IntStack* s, int*x); // 스택에서 데이털르 피크void Clear(IntStack* s); // 스택 비우기int Capacity(cons..
#includeusing namespace std;void change(int &a, int &b);int main(){ int arr[5] = { 7,6,2,4,1 }; int change_count = 0; int compare_count = 0; for (int i = 0;i arr[j + 1]) { change(arr[j], arr[j + 1]); change_count++; for (int k = 0;k
#includeusing namespace std;void reverseDisplay(int value);int main(){ int n; cin >> n; reverseDisplay(n); return 0;}void reverseDisplay(int value){ if (value #includeusing namespace std;void reverseDisplay(const string &s);int main(){ string c; cin >> c; reverseDisplay(c); return 0;}void reverseDisplay(const string &s){ if (s.size() == 0) { return; } string A; cout