// 生命类
class Life
{
protected:
int age; // 年龄
int year; // 寿命
public:
Life(int a, int y):age(a), year(y){}
public:
int getAge() { return age; }
......................
阅读全部
|
gougoudan
贴于 2020年6月30日 16:45
hide
bbsi
#include<stdio.h>
#define Height 10
int calculate(int Long,int Width);
int main()
{
int m_Long;
int m_Width;
int result;
printf("长方形的高度为: %d\n",Height);
......................
阅读全部
|
DJhhh
贴于 2020年6月29日 17:36
hide
bbsi
//1.1
#include <stdio.h>
int main()
{
int i,sum = 0;
for (i = 1; i <= 100; sum += i++){}
printf("%d", sum);
return 0;
}
阅读全部
|
gougoudan
贴于 2020年6月29日 09:59
hide
bbsi
#include <easyx.h>
#include <time.h>
#include <conio.h>
// 公共基类,可以做高级抽象
struct Cell
{
int x, y;
void __update(int deltaX, int deltaY)
{
x += deltaX;
y += deltaY;
......................
阅读全部
|
gougoudan
贴于 2020年6月27日 23:39
hide
bbsi
BEGIN_MESSAGE_MAP(CmfcView, CView)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()
CPoint m_startpt;
void CmfcView::OnLButtonDown(UINT nFlags, CPoint point)
{
m_startpt = point;
SetCapture();
CView::OnLButtonDown(nFlags, point);
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 15:52
hide
bbsi
#include <windows.h>
HWND stringView;
LRESULT CALLBACK WndProc(HWND h, UINT msg, WPARAM w, LPARAM k)
{
switch (msg)
{
case WM_LBUTTONDOWN:
SetWindowText(stringView, "mouse down");
break;
case WM_KEYDOWN:
SetWindowText(stringView, "key down");
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 15:38
hide
bbsi
#include <windows.h>
HINSTANCE hInst; // 当前实例
HWND stringView;
// 函数: WndProc(HWND, UINT, WPARAM, LPARAM)
// 目的: 处理主窗口的消息。
// WM_DESTROY - 发送退出消息并返回
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_LBUTTONDOWN:
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 15:27
hide
bbsi
#include <windows.h>
HINSTANCE hInst; // 当前实例
HWND stringView;
// 函数: WndProc(HWND, UINT, WPARAM, LPARAM)
// 目的: 处理主窗口的消息。
// WM_DESTROY - 发送退出消息并返回
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_LBUTTONDOWN:
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 15:22
hide
bbsi
#include <stdio.h>
void sort(int a[], int n)
{
int i, j;
for (i = 0; i < n - 1; i++){
for (j = 0; j < n - i - 1; j++){
if (a[j] > a[j + 1]){
int tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 11:27
hide
bbsi
#include <stdio.h>
void sort(int a[], int n)
{
int i, j;
for (i = 0; i < n - 1; i++){
for (j = 0; j < n - i - 1; j++){
if (a[j] > a[j + 1]){
int tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
......................
阅读全部
|
gougoudan
贴于 2020年6月24日 11:15
hide
bbsi