?? 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 + -