ezwin.cpp
来自「清华关于C++ 的程序讲义 值得一看 关于算法」· C++ 代码 · 共 34 行
CPP
34 行
// Program 3.5: Compute the time and cost required to mow
// a lawn
#include <iostream>
#include <string>
#include <rect.h>
using namespace std;
int ApiMain() {
const int Width = 8;
const int Height = 7;
int LawnLength = 6;
int LawnWidth = 5;
int HouseLength = 3;
int HouseWidth = 2;
SimpleWindow Window("A Simple Window Demo",
Width, Height);
Window.Open();
RectangleShape Lawn(Window, Width/2.0, Height/2.0,
Green, LawnLength, LawnWidth);
Lawn.Draw();
RectangleShape House(Window, Width/2.0, Height/2.0,
Yellow, HouseLength, HouseWidth);
House.Draw();
cout << "Type a character followed by a\n"
<< "return to remove the window and exit" << endl;
char AnyChar;
cin >> AnyChar;
Window.Close();
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?