贪吃蛇完整版(基于window消息机制的C语言)



win.cpp代码如下

// win1.cpp : 定义应用程序的入口点。
//

#include "stdafx.h"
#include "win1.h"

#define MAX_LOADSTRING 100
#define MAX_wide  840
#define MAX_long  600

// 全局变量:
HINSTANCE hInst;                                // 当前实例
WCHAR szTitle[MAX_LOADSTRING];                  // 标题栏文本
WCHAR szWindowClass[MAX_LOADSTRING];            // 主窗口类名

// 此代码模块中包含的函数的前向声明:
ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // TODO: 在此放置代码。
 hbrush1_SH = CreateSolidBrush(Color_hbrush_1_SH);   //创建蛇体颜色画刷
 hbrush2_QSSH= CreateSolidBrush(Color_hbrush_2_QCSH);  //创建白色画刷
 hbrush3_SW= CreateSolidBrush(Color_hbrush_3_SW);   //创建食物颜色画刷

    // 初始化全局字符串
    LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
    LoadStringW(hInstance, IDC_WIN1, szWindowClass, MAX_LOADSTRING);
    MyRegisterClass(hInstance);

    // 执行应用程序初始化:
    if (!InitInstance (hInstance, nCmdShow))
    {
        return FALSE;
    }

    HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WIN1));

    MSG msg;

    // 主消息循环:
    while (GetMessage(&msg, nullptr, 0, 0))
    {
        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

    return (int) msg.wParam;
}


//
//  函数: MyRegisterClass()
//
//  目的: 注册窗口类。
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEXW wcex;
 static TCHAR szAppName[] = TEXT("Checker3");

    wcex.cbSize = sizeof(WNDCLASSEX);

    wcex.style          = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc    = WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WIN1));
    wcex.hCursor        = LoadCursor(nullptr, IDC_ARROW);
    wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName   = MAKEINTRESOURCEW(IDC_WIN1);
    wcex.lpszClassName  = szWindowClass;
    wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

    return RegisterClassExW(&wcex);
}

//
//   函数: InitInstance(HINSTANCE, int)
//
//   目的: 保存实例句柄并创建主窗口
//
//   注释:
//
//        在此函数中,我们在全局变量中保存实例句柄并
//        创建和显示主程序窗口。
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   hInst = hInstance; // 将实例句柄存储在全局变量中

   HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, CW_USEDEFAULT, 840, 600, nullptr, nullptr, hInstance, nullptr);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

//
//  函数: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  目的:    处理主窗口的消息。
//
//  WM_COMMAND  - 处理应用程序菜单
//  WM_PAINT    - 绘制主窗口
//  WM_DESTROY  - 发送退出消息并返回
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 PAINTSTRUCT ps;
 RECT rect;
 static POINT point;
 HDC hdc;
 static POINT pt[10000];
 static int iCount;     //蛇移动状态

    switch (message)
    {
 case WM_CREATE:     //第一个消息
  SetTimer(hWnd, Time_1, Rate, NULL);    //设置时钟,1000毫秒
  point = { 300,300 };
  break;

 case WM_TIMER:     //定时器
  if (she_shiwu_ZT)
  {
   she_shiwu_ZT = shiwu_rand(hWnd);
  }
  working_she_move(hWnd);  //蛇体的绘制
  break;

    case WM_COMMAND:
        {
            int wmId = LOWORD(wParam);
            // 分析菜单选择:
            switch (wmId)
            {
            case IDM_ABOUT:
                DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
                break;
            case IDM_EXIT:
                DestroyWindow(hWnd);
                break;
   default:
                return DefWindowProc(hWnd, message, wParam, lParam);
            }

        }
        break;

 case WM_CHAR:
  switch (wParam)
  {
  case ' ':
   she_wait = ~she_wait;
   break;
  default:
   break;
  }
  break;
 case WM_KEYDOWN:
  if (she_wait)
  {
   switch (wParam)
   {
   case VK_RIGHT:
    she_head = she_right;
    return 0;
   case VK_LEFT:
    she_head = she_left;
    return 0;
   case VK_UP:
    she_head = she_up;
    return 0;
   case VK_DOWN:
    she_head = she_down;
    return 0;
   default:
    return 0;
   }
  }
  break;

 case WM_LBUTTONDOWN:      //鼠标左键按下  
  return 0;

 case WM_RBUTTONUP:       //鼠标右键按起
  restting(hWnd);
  return 0;

 case WM_MOUSEMOVE:       //鼠标移动
  return 0;

 case WM_LBUTTONUP:       //鼠标左键按起
  return 0;

    case WM_PAINT:
        {
            hdc = BeginPaint(hWnd, &ps);  //获取设备环境句柄
            //TODO: 在此处添加使用 hdc 的任何绘图代码...

   GetClientRect(hWnd, &rect);
   working(hWnd, hdc, rect);              //绘制图形的具体代码
            EndPaint(hWnd, &ps);     //释放设备环境句柄

   working_sheti_Initialize(hWnd);   //初始化蛇体
        }
        break;
    case WM_DESTROY:
  KillTimer(hWnd, Time_1);    //结束时钟
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

// “关于”框的消息处理程序。
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}



stdafx.h  代码如下


// win1.cpp : 定义应用程序的入口点。
//
#include "stdafx.h"
#include "win1.h"
#define MAX_LOADSTRING 100
#define MAX_wide  840
#define MAX_long  600
// 全局变量:
HINSTANCE hInst;                                // 当前实例
WCHAR szTitle[MAX_LOADSTRING];                  // 标题栏文本
WCHAR szWindowClass[MAX_LOADSTRING];            // 主窗口类名
// 此代码模块中包含的函数的前向声明:
ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);
    // TODO: 在此放置代码。
 hbrush1_SH = CreateSolidBrush(Color_hbrush_1_SH);   //创建蛇体颜色画刷
 hbrush2_QSSH= CreateSolidBrush(Color_hbrush_2_QCSH);  //创建白色画刷
 hbrush3_SW= CreateSolidBrush(Color_hbrush_3_SW);   //创建食物颜色画刷
    // 初始化全局字符串
    LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
    LoadStringW(hInstance, IDC_WIN1, szWindowClass, MAX_LOADSTRING);
    MyRegisterClass(hInstance);
    // 执行应用程序初始化:
    if (!InitInstance (hInstance, nCmdShow))
    {
        return FALSE;
    }
    HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WIN1));
    MSG msg;
    // 主消息循环:
    while (GetMessage(&msg, nullptr, 0, 0))
    {
        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }
    return (int) msg.wParam;
}

//
//  函数: MyRegisterClass()
//
//  目的: 注册窗口类。
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEXW wcex;
 static TCHAR szAppName[] = TEXT("Checker3");
    wcex.cbSize = sizeof(WNDCLASSEX);
    wcex.style          = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc    = WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WIN1));
    wcex.hCursor        = LoadCursor(nullptr, IDC_ARROW);
    wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName   = MAKEINTRESOURCEW(IDC_WIN1);
    wcex.lpszClassName  = szWindowClass;
    wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
    return RegisterClassExW(&wcex);
}
//
//   函数: InitInstance(HINSTANCE, int)
//
//   目的: 保存实例句柄并创建主窗口
//
//   注释:
//
//        在此函数中,我们在全局变量中保存实例句柄并
//        创建和显示主程序窗口。
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   hInst = hInstance; // 将实例句柄存储在全局变量中
   HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, CW_USEDEFAULT, 840, 600, nullptr, nullptr, hInstance, nullptr);
   if (!hWnd)
   {
      return FALSE;
   }
   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);
   return TRUE;
}
//
//  函数: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  目的:    处理主窗口的消息。
//
//  WM_COMMAND  - 处理应用程序菜单
//  WM_PAINT    - 绘制主窗口
//  WM_DESTROY  - 发送退出消息并返回
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 PAINTSTRUCT ps;
 RECT rect;
 static POINT point;
 HDC hdc;
 static POINT pt[10000];
 static int iCount;     //蛇移动状态
    switch (message)
    {
 case WM_CREATE:     //第一个消息
  SetTimer(hWnd, Time_1, Rate, NULL);    //设置时钟,1000毫秒
  point = { 300,300 };
  break;
 case WM_TIMER:     //定时器
  if (she_shiwu_ZT)
  {
   she_shiwu_ZT = shiwu_rand(hWnd);
  }
  working_she_move(hWnd);  //蛇体的绘制
  break;
    case WM_COMMAND:
        {
            int wmId = LOWORD(wParam);
            // 分析菜单选择:
            switch (wmId)
            {
            case IDM_ABOUT:
                DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
                break;
            case IDM_EXIT:
                DestroyWindow(hWnd);
                break;
   default:
                return DefWindowProc(hWnd, message, wParam, lParam);
            }
        }
        break;
 case WM_CHAR:
  switch (wParam)
  {
  case ' ':
   she_wait = ~she_wait;
   break;
  default:
   break;
  }
  break;
 case WM_KEYDOWN:
  if (she_wait)
  {
   switch (wParam)
   {
   case VK_RIGHT:
    she_head = she_right;
    return 0;
   case VK_LEFT:
    she_head = she_left;
    return 0;
   case VK_UP:
    she_head = she_up;
    return 0;
   case VK_DOWN:
    she_head = she_down;
    return 0;
   default:
    return 0;
   }
  }
  break;
 case WM_LBUTTONDOWN:      //鼠标左键按下  
  return 0;
 case WM_RBUTTONUP:       //鼠标右键按起
  restting(hWnd);
  return 0;
 case WM_MOUSEMOVE:       //鼠标移动
  return 0;
 case WM_LBUTTONUP:       //鼠标左键按起
  return 0;
    case WM_PAINT:
        {
            hdc = BeginPaint(hWnd, &ps);  //获取设备环境句柄
            //TODO: 在此处添加使用 hdc 的任何绘图代码...
   GetClientRect(hWnd, &rect);
   working(hWnd, hdc, rect);              //绘制图形的具体代码
            EndPaint(hWnd, &ps);     //释放设备环境句柄
   working_sheti_Initialize(hWnd);   //初始化蛇体
        }
        break;
    case WM_DESTROY:
  KillTimer(hWnd, Time_1);    //结束时钟
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
// “关于”框的消息处理程序。
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;
    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}


win.h 代码如下


#pragma once
#include "resource.h"
//自定义函数声明
//初始化蛇体
void working_sheti_Initialize(HWND);   //初始化蛇体
int working_she_move(HWND);      //蛇体的移动 绘图---- 蛇体的绘制
void she_shiwu_eat(POINT);      //蛇吃到食物的处理
int shiwu_rand(HWND);       //食物的绘制与处理
void Free_she(void);       //释放所有建立的空间
void restting(HWND);       //重置所有,各类置初始
int  she_fail(void);       //蛇碰壁,游戏结束
//定义
//
#define Time_1 1        //定时器1
#define Rate 300        //初始速度1000毫秒
#define Color_hbrush_1_SH RGB(255,0,0)  //画刷颜色1
#define Color_hbrush_2_QCSH RGB(255,255,255) //白色画刷
#define Color_hbrush_3_SW RGB(0,0,255)
//定义射移动的方向选择
#define she_left 1       
#define she_right 2
#define she_up  3
#define she_down 4
//全局变量
//
static int she_wide,she_long;    //蛇单体宽和高
static POINT Shiwu_point;    //食物坐标
HBRUSH hbrush1_SH,hbrush2_QSSH,hbrush3_SW; //画刷句柄
int she_shiwu_ZT = 1;      //1表示没有食物
unsigned int she_wait = 0;     //蛇的运动状态 0表示暂停
unsigned int she_head = 2;     //定义蛇移动的原始方向
unsigned int number_result=0;    //得到的分数
//绘制图形
//
//目的:绘制处理
//
void working(HWND hWnd, HDC hdc, RECT rect)

 TCHAR Tchar_working[100];
   //赋值给Tchar_working
 she_wide = rect.right / 84;
 she_long = rect.bottom / 60;
 MoveToEx(hdc, rect.right / 14 * 10, rect.top, NULL);
 LineTo(hdc, rect.right / 14 * 10, rect.bottom);  //右边积分区
 TextOut(hdc, she_wide * 70, she_long * 10, Tchar_working,
  wsprintf(Tchar_working, TEXT("得到的分数:")));
 Rectangle(hdc, 0, 0, she_wide*60, she_long*60);   //蛇正常活动区域
}

//定义链表来存蛇体
//
typedef struct SHE {
 struct SHE *link;
 POINT struct_point;
}she;
static she *head;
#define SHE_MALLOC (she *) malloc(sizeof(she))   //给链表分配空间
static int she_number = 1;      //蛇的长度

//初始化蛇体
//初始化蛇体
void working_sheti_Initialize(HWND hWnd)
{
 RECT rect;
 she *p1;
 HDC  hdc;
 GetClientRect(hWnd, &rect);
 head  = SHE_MALLOC;
 head->struct_point.x = rect.right/84*30;
 head->struct_point.y = rect.bottom/60*30;
 p1 = SHE_MALLOC;
 head->link = p1;
 p1->struct_point.x = head->struct_point.x-she_wide;
 p1->struct_point.y = head->struct_point.y;
 p1->link = NULL;
 hdc = GetDC(hWnd);
 SelectObject(hdc, GetStockObject(NULL_PEN));
 SelectObject(hdc, hbrush1_SH);
 Rectangle(hdc, head->struct_point.x, head->struct_point.y,
  head->struct_point.x + she_wide, head->struct_point.y + she_long);
 Rectangle(hdc, p1->struct_point.x, p1->struct_point.y,
   p1->struct_point.x + she_wide, p1->struct_point.y + she_long);
 ReleaseDC(hWnd, hdc);
}

//绘图---- 蛇体的绘制
//
//蛇体的移动
//
//
int working_she_move(HWND hWnd)

 HDC hdc;
 static POINT point;
 static she *p1,*p2;
 static unsigned move_PD ;
 point = { 0,0 };
 move_PD = 1;
 while (move_PD)
 {
  move_PD = 0;
  switch (she_head)
  {
  case she_left:
   point.x = -she_wide;
   if (head->struct_point.x + point.x == head->link->struct_point.x)
   {
    she_head = she_right;
    move_PD = 1;
   }
   break;
  case she_right:
   point.x = she_wide;
   if (head->struct_point.x + point.x == head->link->struct_point.x)
   {
    she_head = she_left;
    move_PD = 1;
   }
   break;
  case she_up:
   point.y = -she_long;
   if (head->struct_point.y + point.y == head->link->struct_point.y)
   {
    she_head = she_down;
    move_PD = 1;
   }
   break;
  case she_down:
   point.y = she_long;
   if (head->struct_point.y + point.y == head->link->struct_point.y)
   {
    she_head = she_up;
    move_PD = 1;
   }
   break;
  default:
   break;
  }
 }
 if(she_head && she_wait)
 {
  p1 = SHE_MALLOC;
  p1->struct_point.x = head->struct_point.x+point.x;
  p1->struct_point.y = head->struct_point.y + point.y;
  p1->link = head;
  head = p1;
  if (she_fail())    //判断蛇移动是否超过活动区域
  {
   restting(hWnd);
   return 0;
  }
  hdc = GetDC(hWnd);
  SelectObject(hdc, GetStockObject(NULL_PEN));
  SelectObject(hdc, hbrush1_SH);
  Rectangle(hdc, head->struct_point.x, head->struct_point.y,
   head->struct_point.x + she_wide, head->struct_point.y + she_long);
  while (p1->link)
  {
   p2 = p1;
   p1 = p1->link;
  }
  SelectObject(hdc, hbrush2_QSSH);    //获取环境句柄
  Rectangle(hdc, p1->struct_point.x, p1->struct_point.y,
   p1->struct_point.x + she_wide, p1->struct_point.y + she_long);
  
  p2->link = NULL;
  free(p1);
 
 //此间进行判断处理
  if (head->struct_point.x == Shiwu_point.x*she_wide &&
   head->struct_point.y == Shiwu_point.y*she_long ) //如果食物和蛇头重叠
  {
   she_shiwu_eat(point);         //进入食物与蛇处理
   TCHAR tchar[20];
   TextOut(hdc, she_wide * 80, she_long * 10, tchar,
     wsprintf(tchar, TEXT("%d"), number_result));
  }
  ReleaseDC(hWnd, hdc);     //释放环境句柄
 }
 return 0;
}

//食物的绘制与产生
//
//
int shiwu_rand(HWND hWnd)

 HDC hdc;
 srand((unsigned)time(NULL));   // 使用系统时间作为随机种子
 Shiwu_point.x = rand()%60;     //产生一个0-61的随机数
 Shiwu_point.y = rand() % 60;
 hdc = GetDC(hWnd);      //获取环境句柄
 SelectObject(hdc, GetStockObject(NULL_PEN));
 SelectObject(hdc, hbrush3_SW);
 Rectangle(hdc, Shiwu_point.x*she_wide, Shiwu_point.y*she_long,
  (Shiwu_point.x +1) *she_wide, (Shiwu_point.y +1)* she_long);
 ReleaseDC(hWnd, hdc);     //释放环境句柄
 return 0;        //返回0表示已经产生食物
}

//蛇吃到食物处理
//
void she_shiwu_eat(POINT point)
{
 she *p1,*p2;
 p1 = SHE_MALLOC;
 p1->struct_point.x = point.x;
 p1->struct_point.y = point.y;
 p2 = head->link;
 head->link = p1;;
 p1->link = p2;
 number_result++;  //分数加一
 she_shiwu_ZT = 1;  //置1食物,表示食物已经没有了
 //Sleep(10000);
}
//释放掉所有建立的链表单位
//
//
void Free_she(void)
{
 she *p1;
 
 while (head->link)
 {
  p1 = head;
  head = p1->link;
  free(p1);
 }
 free(head);
}
//重新开始 各类置初始
//重新开始 各类置初始
//重新开始 各类置初始
void restting(HWND hWnd)
{
 //重新开始 各类置初始
 InvalidateRect(hWnd, NULL, TRUE);  //鼠标按起,清除绘图
 Free_she();        //释放所有空间
 working_sheti_Initialize(hWnd);   //重新初始化蛇体
 she_head = 1;       //蛇的方向置右
 she_shiwu_ZT = 1;      //蛇食物状态置没有
 she_wait = 0;       //蛇移动状态置暂停
 number_result = 0;      //分数置零
}
//蛇碰壁,游戏结束
//蛇碰壁,游戏结束
//
int she_fail(void)
{
 she *p1;
 //蛇超过活动区域
 if (head->struct_point.x <0 || head->struct_point.x>59 * she_wide ||
  head->struct_point.y <0 || head->struct_point.y>59 * she_wide)
 {
  return 1;
 }
 //蛇吃到自己的身体
 p1 = head;
 while (p1->link)
 {
  p1 = p1->link;
  if (head->struct_point.x == p1->struct_point.x &&
   head->struct_point.y == p1->struct_point.y)
  {
   return 1;
  }
 }
 return 0;
}

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值