program_10_3.cpp

来自「清华关于C++ 的程序讲义 值得一看 关于算法」· C++ 代码 · 共 33 行

CPP
33
字号
// Hello Ezwindows program
#include <cassert>
#include <ezwin>

using namespace std;

SimpleWindow HelloWindow("Hello EzWndows", 10., 4., Position(5., 6.));

// ApiMain(): create a window and display greeting
int ApiMain() {
	HelloWindow.Open();
	assert(HelloWindow.GetStatus() == WindowOpen);

	// Get Center of Window
	Position Center = HelloWindow.GetCenter();

	// Create bounding box for text
	Position UpperLeft = Center + Position(-1., -1.);
	Position LowerRight = Center + Position(1., 1.);

	// Display the text
	HelloWindow.RenderText(UpperLeft, LowerRight, "Hello Ezwindows", White, Black);

	return 0;
}

// ApiEnd(): shutdown the window
int ApiEnd() {
	HelloWindow.Close();

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?