![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言基础
文章平均质量分 83
金戋小铺
就是破修设备的
展开
-
刚学c两个礼拜,写的推箱子(控制台版本)
#include #include int map[7][10]={ { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, { 0, 1, 0, 0, 0, 0, 0, 1, 1, 1 }, { 1, 1, 2, 1, 1, 1, 0, 0, 0, 1 }, { 1, 0, 3, 0, 2, 0, 0, 2, 0, 1 }, { 1, 0, 4, 4, 1, 0原创 2017-07-12 15:56:48 · 254 阅读 · 0 评论 -
win32菜单练习复习
#include #include #include HANDLE handle; HMENU hpopupmenu; void OnSysMenu(HWND hwnd) { HMENU hsysmenu=GetSystemMenu(hwnd, 0); DeleteMenu(hsysmenu, 0,MF_BYPOSITION); AppendMenu(hsysmenu, MF_S原创 2017-09-16 12:53:54 · 248 阅读 · 1 评论 -
(BFS稍微变化)实现连连看过程,带连线,无通关
#pragma once #include"InitializeMap.h" #include #include"resource.h" class LoadingResource { unsigned Msize; HBITMAP** hbitmap; public: LoadingResource(); ~LoadingResource(); void Loadingim原创 2017-08-26 18:38:56 · 270 阅读 · 0 评论 -
BFS(广度优先搜索)这里用来两种方法存储路径,1.同map大小的数组来存储路径2.通过生成反向树状结构存储路径
#include #include #include using namespace std; struct point//点的结构体 { point(int x, int y) :x(x), y(y){}//带参构造 point(){};//无参构造 point &operator=(point & a)//重载= { x = a.x; y = a.y; return *原创 2017-08-20 20:26:49 · 883 阅读 · 0 评论 -
win32和DFS(目前不能限制拐弯数为2)实现假的连连看
#include #include #include #include #include"resource.h" #include #include using namespace std; struct point//点的结构体 { point(int x, int y) :x(x), y(y){}//带参构造 point(){};//无参构造 point &opera原创 2017-08-15 11:21:02 · 258 阅读 · 0 评论 -
笔记:堆的增删改查(数组实现)
思路:增的话在数组最后增加,依次找他的父节点并比较满足直接跳出,不满足交换,并将父节点赋值给当前节点,一次往上比较,直到找完 删的话首先只能删除堆顶,即将尾节点的值赋给根节点,Len--,然后将新的堆顶依次和子节点比较,满足则跳出,不满足交换,并更改当前节点,一次往下比较,直到越界, 初始化的话就简单了,从最后一个有子节点的父节点,执行删除的的循环比较操作,原创 2017-08-19 19:16:35 · 493 阅读 · 0 评论 -
DFS(深度优先搜索)弊端:不一定是最优路径
#include #include using namespace std; struct point//点的结构体 { point(int x,int y) :x(x), y(y){}//带参构造 point(){};//无参构造 point &operator=(point & a)//重载= { x = a.x; y = a.y; return *this; } p原创 2017-08-12 13:06:37 · 2637 阅读 · 0 评论 -
学c时的一个作业
作业描述:如图用递归一次输出每个矩形的四个角标 #include void print(int zero, int len) { printf("%d %d %d %d\n", zero, zero + len, zero + len * 5, zero + len * 6);//边角值公式 if (1 == len) return; /* 田字格递归循环中由大到小,依次输原创 2017-07-12 16:09:14 · 208 阅读 · 0 评论 -
快速排序,希尔排序以及KMP字符查找算法
#include void quicksort(int arr[], int left, int right)//快速排序 { int low = left; int high = right; int temp = arr[left];//挖第一个坑 if (left > right)//递归出口 { return; } while (low != high) { for原创 2017-07-13 15:11:34 · 273 阅读 · 0 评论 -
C语言简单用链表实现学生管理系统
#define _CRT_SECURE_NO_WARNINGS #include #include #include #include FILE *stud; FILE *tempx; enum operation { key_1 = '1', key_2 = '2', key_3 = '3', key_4 = '4', key_5 = '5', key_6 = '6'原创 2017-07-13 15:11:02 · 4343 阅读 · 0 评论 -
用c实现俄罗斯方块游戏过程
#include #include #include #include #include #define ROW_AR 28 #define COL_AR 14 #define BLOCK_X 4 #define BLOCK_Y 2 #define originallocationX 7 #define originallocationY 7 int start, end,原创 2017-07-12 16:02:17 · 645 阅读 · 0 评论 -
简单实现贪吃蛇玩法(非智能版还没那水平)
#include #include #include #include #include #define N 200 #define MAP_X 18 #define MAP_Y 35 #define SPEED 150 int start,end; char G='T'; enum BLock { BLOCK_NULL, BLOCK_FRAME, BLOCK_BL原创 2017-07-12 16:04:46 · 192 阅读 · 0 评论