📄 test.cpp
字号:
// 这是使用应用程序向导生成的 VC++
// 应用程序项目的主项目文件。
#include <string>
#include <iostream>
#include "graphics.cpp"
void main()
{
console_dc dc(22,79);
graphics grap(dc);
char command[20],outputstr[200];
int iscontinue=1;
int p1x,p1y,p2x,p2y;
char point_type,border_char,filled_char;
grap.clear();
while(iscontinue)
{
cout<<"___________________________________________________"<<endl;
cout<<"Intput your command:(Enter 'Q' to exit!)"<<endl;
scanf("%s",command);
switch(*command)
{
case 'q':case 'Q':
iscontinue=0;
break;
case 'r':
cin>>p1x>>p1y>>p2x>>p2y;
grap.rect(point(p1x,p1y),point(p2x,p2y));
break;
case 'l':
cin>>p1x>>p1y>>p2x>>p2y;
grap.line(point(p1x,p1y),point(p2x,p2y));
break;
case 's':
cin>>point_type;
grap.set_point_type(point_type);
break;
case 'f':
cin>>p1x>>p1y>>border_char>>filled_char;
grap.fill(point(p1x,p1y),border_char,filled_char);
break;
case 'o':
cin>>p1x>>p1y;
scanf("%s",outputstr);
grap.output_string(point(p1x,p1y),outputstr);
break;
case 'c':
grap.clear();
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -